Message ID | E1muXkD-00ARj4-JS@www.linuxtv.org |
---|---|
State | Accepted |
Commit | 8aa637bf6d70d2fb2ad4d708d8b9dd02b1c095df |
Headers | show |
Series | [git:media_stage/master] media: uvcvideo: fix division by zero at stream start | expand |
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 9f37eaf28ce7..1b4cc934109e 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -1963,6 +1963,10 @@ static int uvc_video_start_transfer(struct uvc_streaming *stream, if (ep == NULL) return -EIO; + /* Reject broken descriptors. */ + if (usb_endpoint_maxp(&ep->desc) == 0) + return -EIO; + ret = uvc_init_video_bulk(stream, ep, gfp_flags); }