1
0
Fork 0

media: usbvision: fix a potential NULL pointer dereference

In case usb_alloc_coherent fails, the fix returns -ENOMEM to
avoid a potential NULL pointer dereference.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
hifive-unleashed-5.2
Kangjie Lu 2019-03-09 02:42:26 -05:00 committed by Mauro Carvalho Chehab
parent aeb0d0f581
commit f8ee34c3e7
1 changed files with 3 additions and 0 deletions

View File

@ -2302,6 +2302,9 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
sb_size,
GFP_KERNEL,
&urb->transfer_dma);
if (!usbvision->sbuf[buf_idx].data)
return -ENOMEM;
urb->dev = dev;
urb->context = usbvision;
urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);