]> git.baikalelectronics.ru Git - kernel.git/commit
media: uvcvideo: Prevent setting unavailable flags
authorKieran Bingham <kieran.bingham@ideasonboard.com>
Wed, 21 Mar 2018 15:43:08 +0000 (11:43 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 5 Jun 2018 13:33:51 +0000 (09:33 -0400)
commit109556a946f3d0a203894c5768805a4c49459573
tree700e5bfc8627f1ddb20c8c754032777a2ea14188
parentb707d29be745c0f67ff0ae5f6d81873244709662
media: uvcvideo: Prevent setting unavailable flags

The addition of an extra operation to use the GET_INFO command
overwrites all existing flags from the uvc_ctrls table. This includes
setting all controls as supporting GET_MIN, GET_MAX, GET_RES, and
GET_DEF regardless of whether they do or not.

Move the initialisation of these control capabilities directly to the
uvc_ctrl_fill_xu_info() call where they were originally located in that
use case, and ensure that the new functionality in uvc_ctrl_get_flags()
will only set flags based on their reported capability from the GET_INFO
call.

Fixes: 870a4fc695b8 ("media: uvcvideo: Apply flags from device to actual properties")
Cc: stable@vger.kernel.org
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c