linux-omap 2.6.37: sync with OE .dev
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / media / 0034-v4l-Fix-a-use-before-set-in-the-control-framework.patch
1 From d887b7e4224fa03f080ab6ede038eee8aac4c221 Mon Sep 17 00:00:00 2001
2 From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
3 Date: Tue, 7 Dec 2010 12:57:25 +0100
4 Subject: [PATCH 34/43] v4l: Fix a use-before-set in the control framework
6 v4l2_queryctrl sets the step value based on the control type. That would
7 be fine if it used the control type stored in the V4L2 kernel control
8 object, not the one stored in the userspace ioctl structure that has
9 just been memset to 0. Fix this.
11 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
12 Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
13 ---
14  drivers/media/video/v4l2-ctrls.c |    2 +-
15  1 files changed, 1 insertions(+), 1 deletions(-)
17 diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
18 index 9d2502c..5f74fec 100644
19 --- a/drivers/media/video/v4l2-ctrls.c
20 +++ b/drivers/media/video/v4l2-ctrls.c
21 @@ -1338,7 +1338,7 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)
22         qc->minimum = ctrl->minimum;
23         qc->maximum = ctrl->maximum;
24         qc->default_value = ctrl->default_value;
25 -       if (qc->type == V4L2_CTRL_TYPE_MENU)
26 +       if (ctrl->type == V4L2_CTRL_TYPE_MENU)
27                 qc->step = 1;
28         else
29                 qc->step = ctrl->step;
30 -- 
31 1.6.6.1