aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-04-29 20:18:01 (GMT)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-08-09 13:45:17 (GMT)
commitcba76eb78667c8429916475618db0559ee2d9cbf (patch)
tree5e71118c3b76e5076e36f0f0a1b194ef796edbba
parent941ea3616c747545d0278fc432fb7919b6d0d8f0 (diff)
usb: gadget/uvc: Fix error handling in uvc_queue_buffer()uvc-gadget
The conversion to videobuf2 failed to check the return value of vb2_qbuf(). Fix it. Cc: stable@vger.kernel.org Reported-by: Michael Grzeschik <mgr@pengutronix.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-By: Michael Grzeschik <mgr@pengutronix.de>
-rw-r--r--drivers/usb/gadget/uvc_queue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/gadget/uvc_queue.c b/drivers/usb/gadget/uvc_queue.c
index e617047..0bb5d50 100644
--- a/drivers/usb/gadget/uvc_queue.c
+++ b/drivers/usb/gadget/uvc_queue.c
@@ -193,12 +193,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;
}

Privacy Policy