@@ -998,10 +998,8 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh,
struct v4l2_queryctrl qc = { .id = ctrl->id };
ret = uvc_query_v4l2_ctrl(chain, &qc);
- if (ret < 0) {
- ctrls->error_idx = i;
- return ret;
- }
+ if (ret < 0)
+ goto set_index;
ctrl->value = qc.default_value;
}
@@ -1017,14 +1015,17 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh,
ret = uvc_ctrl_get(chain, ctrl);
if (ret < 0) {
uvc_ctrl_rollback(handle);
- ctrls->error_idx = i;
- return ret;
+ goto set_index;
}
}
ctrls->error_idx = 0;
return uvc_ctrl_rollback(handle);
+
+set_index:
+ ctrls->error_idx = i;
+ return ret;
}
static int uvc_ioctl_s_try_ext_ctrls(struct uvc_fh *handle,