aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_v4l2.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-01-23 07:07:53 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 15:11:04 -0300
commite54532e591cd5b9ce77dbc8d9786ae9f600f101a (patch)
tree725c07637e0197acd3176827299d4186962221e4 /drivers/media/video/uvc/uvc_v4l2.c
parent59529081e092506edb81a42d914e2d0522f65ca7 (diff)
downloadkernel_samsung_smdk4412-e54532e591cd5b9ce77dbc8d9786ae9f600f101a.zip
kernel_samsung_smdk4412-e54532e591cd5b9ce77dbc8d9786ae9f600f101a.tar.gz
kernel_samsung_smdk4412-e54532e591cd5b9ce77dbc8d9786ae9f600f101a.tar.bz2
V4L/DVB: uvcvideo: Clamp control values to the minimum and maximum values
When setting a control, the V4L2 specification requires drivers to either clamp the control value to the [minimum, maximum] range or return the -ERANGE error. Fix the driver to clamp control values to the valid range in uvc_ctrl_set() and make sure the value differs from the minimum by an integer multiple of step. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_v4l2.c')
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index 23239a4..bf1fc7f 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -549,6 +549,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
return ret;
}
ret = uvc_ctrl_commit(chain);
+ if (ret == 0)
+ ctrl->value = xctrl.value;
break;
}