Commit ebe864a6 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Felipe Balbi

usb: gadget: uvc: Fix error handling in uvc_queue_buffer()

The conversion to videobuf2 failed to check the return value of
vb2_qbuf(). Fix it.

Cc: stable@vger.kernel.org
Reported-by: default avatarMichael Grzeschik <mgr@pengutronix.de>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-By: default avatarMichael Grzeschik <mgr@pengutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 9b3452d1
...@@ -193,12 +193,16 @@ static int uvc_queue_buffer(struct uvc_video_queue *queue, ...@@ -193,12 +193,16 @@ static int uvc_queue_buffer(struct uvc_video_queue *queue,
mutex_lock(&queue->mutex); mutex_lock(&queue->mutex);
ret = vb2_qbuf(&queue->queue, buf); ret = vb2_qbuf(&queue->queue, buf);
if (ret < 0)
goto done;
spin_lock_irqsave(&queue->irqlock, flags); spin_lock_irqsave(&queue->irqlock, flags);
ret = (queue->flags & UVC_QUEUE_PAUSED) != 0; ret = (queue->flags & UVC_QUEUE_PAUSED) != 0;
queue->flags &= ~UVC_QUEUE_PAUSED; queue->flags &= ~UVC_QUEUE_PAUSED;
spin_unlock_irqrestore(&queue->irqlock, flags); spin_unlock_irqrestore(&queue->irqlock, flags);
mutex_unlock(&queue->mutex);
done:
mutex_unlock(&queue->mutex);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment