[media] uvcvideo: Fix incorrect bandwidth with Chicony device 04f2:b50b
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 12 May 2015 21:57:53 +0000 (18:57 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 30 May 2015 15:12:15 +0000 (12:12 -0300)
commit37f85b276a36b531234992b05eb057841af46fb4
treec077d309dc7e2186ba576c2df01a87bad938a8ed
parent7195f61b801104add6453e1d8a39d5c8366fc446
[media] uvcvideo: Fix incorrect bandwidth with Chicony device 04f2:b50b

The "TOSHIBA Web Camera - 5M" Chicony device (04f2:b50b) seems to
compute the bandwidth on 16 bits and erroneously sign-extend it to
32 bits, resulting in a huge bandwidth value. Detect and fix that
condition by setting the 16 MSBs to 0 when they're all equal to 1.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/uvc/uvc_video.c