media: uvcvideo: Silence shift-out-of-bounds warning
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 18 Aug 2020 23:56:49 +0000 (01:56 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 10 Sep 2020 12:06:27 +0000 (14:06 +0200)
commit171994e498a0426cbe17f874c5c6af3c0af45200
tree8913618d845b41fb400db6e0830f5492a2f53604
parentf875bcc375c738bf2f599ff2e1c5b918dbd07c45
media: uvcvideo: Silence shift-out-of-bounds warning

UBSAN reports a shift-out-of-bounds warning in uvc_get_le_value(). The
report is correct, but the issue should be harmless as the computed
value isn't used when the shift is negative. This may however cause
incorrect behaviour if a negative shift could generate adverse side
effects (such as a trap on some architectures for instance).

Regardless of whether that may happen or not, silence the warning as a
full WARN backtrace isn't nice.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c