diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-12-07 06:57:25 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-19 08:52:10 -0500 |
commit | eac9aa005a2e0676d07f1906f9933fd055eb1f0b (patch) | |
tree | 8345ab2b708e729163f14bb74a68f328c188a2eb /drivers | |
parent | 01c40c048b0f3f377e6d27b35fd99f04efcc21dd (diff) |
[media] v4l: Fix a use-before-set in the control framework
v4l2_queryctrl sets the step value based on the control type. That would
be fine if it used the control type stored in the V4L2 kernel control
object, not the one stored in the userspace ioctl structure that has
just been memset to 0. Fix this.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/v4l2-ctrls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 01251431fd2a..ef66d2af0c57 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c | |||
@@ -1352,7 +1352,7 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc) | |||
1352 | qc->minimum = ctrl->minimum; | 1352 | qc->minimum = ctrl->minimum; |
1353 | qc->maximum = ctrl->maximum; | 1353 | qc->maximum = ctrl->maximum; |
1354 | qc->default_value = ctrl->default_value; | 1354 | qc->default_value = ctrl->default_value; |
1355 | if (qc->type == V4L2_CTRL_TYPE_MENU) | 1355 | if (ctrl->type == V4L2_CTRL_TYPE_MENU) |
1356 | qc->step = 1; | 1356 | qc->step = 1; |
1357 | else | 1357 | else |
1358 | qc->step = ctrl->step; | 1358 | qc->step = ctrl->step; |