mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
usb: gadget: uvc: Fix error handling in uvc_queue_buffer()
commit ebe864a6cb upstream.
The conversion to videobuf2 failed to check the return value of
vb2_qbuf(). Fix it.
Reported-by: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c552e84c9b
commit
ec7329b595
@@ -177,12 +177,16 @@ static int uvc_queue_buffer(struct uvc_video_queue *queue,
|
||||
|
||||
mutex_lock(&queue->mutex);
|
||||
ret = vb2_qbuf(&queue->queue, buf);
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
||||
spin_lock_irqsave(&queue->irqlock, flags);
|
||||
ret = (queue->flags & UVC_QUEUE_PAUSED) != 0;
|
||||
queue->flags &= ~UVC_QUEUE_PAUSED;
|
||||
spin_unlock_irqrestore(&queue->irqlock, flags);
|
||||
mutex_unlock(&queue->mutex);
|
||||
|
||||
done:
|
||||
mutex_unlock(&queue->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user