Commit b41869711586b047c18435ba84baf334918bae01

Authored by Laurent Pinchart
Committed by Mauro Carvalho Chehab
1 parent 1e2e9086c7

[media] uvcvideo: Return -EINVAL when setting a menu control to an invalid value

-ERANGE is the right error code when the value is outside of the menu
range, but -EINVAL must be reported for invalid values inside the range.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/media/usb/uvc/uvc_ctrl.c
... ... @@ -1487,7 +1487,7 @@
1487 1487 step = mapping->get(mapping, UVC_GET_RES,
1488 1488 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES));
1489 1489 if (!(step & value))
1490   - return -ERANGE;
  1490 + return -EINVAL;
1491 1491 }
1492 1492  
1493 1493 break;