mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
media: uvcvideo: Fix bit overflow in uvc_probe_video
probe->dwMaxPayloadTransferSize is a 32bit value, but bandwidth is 16bit. This may lead to a bit overflow. Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
261f33388c
commit
1c8af8e937
|
|
@ -383,7 +383,6 @@ int uvc_probe_video(struct uvc_streaming *stream,
|
|||
struct uvc_streaming_control *probe)
|
||||
{
|
||||
struct uvc_streaming_control probe_min, probe_max;
|
||||
u16 bandwidth;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
|
|
@ -421,8 +420,7 @@ int uvc_probe_video(struct uvc_streaming *stream,
|
|||
if (stream->intf->num_altsetting == 1)
|
||||
break;
|
||||
|
||||
bandwidth = probe->dwMaxPayloadTransferSize;
|
||||
if (bandwidth <= stream->maxpsize)
|
||||
if (probe->dwMaxPayloadTransferSize <= stream->maxpsize)
|
||||
break;
|
||||
|
||||
if (stream->dev->quirks & UVC_QUIRK_PROBE_MINMAX) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user