]> git.baikalelectronics.ru Git - kernel.git/commit
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 20 Dec 2020 14:11:13 +0000 (15:11 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 27 Jan 2021 13:59:27 +0000 (14:59 +0100)
commitc26e3c290a4794138204ca17786f4dc377420424
tree060e9f4fc2c5166ba63c2055e1bc18ba0c551b75
parent79b5f0d1c28a427cbd3a67221da922b7c0e0942f
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values

The Renkforce RF AC4K 300 Action Cam 4K reports invalid bFormatIndex and
bFrameIndex values when negotiating the video probe and commit controls.
The UVC descriptors report a single supported format and frame size,
with bFormatIndex and bFrameIndex both equal to 2, but the video probe
and commit controls report bFormatIndex and bFrameIndex set to 1.

The device otherwise operates correctly, but the driver rejects the
values and fails the format try operation. Fix it by ignoring the
invalid indices, and assuming that the format and frame requested by the
driver are accepted by the device.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=210767
Fixes: 0d3551e53891 ("media: uvcvideo: Ensure all probed info is returned to v4l2")
Reported-by: Till Dörges <doerges@pre-sense.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_v4l2.c