summaryrefslogtreecommitdiffstats
path: root/freed-ora/tags/f16/3.4.7-1.fc16.gnu/uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'freed-ora/tags/f16/3.4.7-1.fc16.gnu/uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch')
-rw-r--r--freed-ora/tags/f16/3.4.7-1.fc16.gnu/uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/freed-ora/tags/f16/3.4.7-1.fc16.gnu/uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch b/freed-ora/tags/f16/3.4.7-1.fc16.gnu/uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch
new file mode 100644
index 000000000..6606b7d3d
--- /dev/null
+++ b/freed-ora/tags/f16/3.4.7-1.fc16.gnu/uvcvideo-Reset-bytesused-field-when-recycling-erroneous-buffer.patch
@@ -0,0 +1,36 @@
+From 3771973542a4807b251352253ed22c50e688e573 Mon Sep 17 00:00:00 2001
+From: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>
+Date: Sun, 15 Jul 2012 15:54:03 +0200
+Subject: [PATCH] uvcvideo: Reset the bytesused field when recycling an erroneous buffer
+
+Buffers marked as erroneous are recycled immediately by the driver if
+the nodrop module parameter isn't set. The buffer payload size is reset
+to 0, but the buffer bytesused field isn't. This results in the buffer
+being immediately considered as complete, leading to an infinite loop in
+interrupt context.
+
+Fix the problem by resetting the bytesused field when recycling the
+buffer.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/video/uvc/uvc_queue.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/media/video/uvc/uvc_queue.c b/drivers/media/video/uvc/uvc_queue.c
+index 9288fbd..5577381 100644
+--- a/drivers/media/video/uvc/uvc_queue.c
++++ b/drivers/media/video/uvc/uvc_queue.c
+@@ -338,6 +338,7 @@ struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue,
+ if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) {
+ buf->error = 0;
+ buf->state = UVC_BUF_STATE_QUEUED;
++ buf->bytesused = 0;
+ vb2_set_plane_payload(&buf->buf, 0, 0);
+ return buf;
+ }
+--
+1.7.2.5
+
OpenPOWER on IntegriCloud