diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-01-21 14:53:11 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:04 -0500 |
commit | 8a4e76c14cbe0609fdb5c558f867fe7c556bb1c7 (patch) | |
tree | 7ecaed2d419ac528b39b4702ca493dd71afbfd30 /drivers/media/video/uvc/uvc_ctrl.c | |
parent | 36bd883ef98ac6003ab6ec7b91f66d3fb2159318 (diff) |
V4L/DVB: uvcvideo: Return -ERANGE when setting a control to an out-of-range menu index
The V4L2 specification states that out of bounds control values must
either be clamped to the valid range or result in a -ERANGE error code.
Fix the driver to return -ERANGE instead of -EINVAL when setting a menu
control to an invalid value.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_ctrl.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index 61576946329d..f4e5ba260968 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -1006,7 +1006,7 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, | |||
1006 | 1006 | ||
1007 | if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) { | 1007 | if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) { |
1008 | if (value < 0 || value >= mapping->menu_count) | 1008 | if (value < 0 || value >= mapping->menu_count) |
1009 | return -EINVAL; | 1009 | return -ERANGE; |
1010 | value = mapping->menu_info[value].value; | 1010 | value = mapping->menu_info[value].value; |
1011 | } | 1011 | } |
1012 | 1012 | ||