summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayakrishnan Memana <jayakrishnan.memana@maxim-ic.com>2012-07-15 10:54:03 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 10:00:20 -0700
commit190d60406f1e111bd212e271076bdab9e104ebe6 (patch)
tree2f1a52e9ac44960821dbcaba4e14dd294a14dbf1
parentebad30a797a5e5093d69e39bc046edab9452fe00 (diff)
downloadlinux-3.10-190d60406f1e111bd212e271076bdab9e104ebe6.tar.gz
linux-3.10-190d60406f1e111bd212e271076bdab9e104ebe6.tar.bz2
linux-3.10-190d60406f1e111bd212e271076bdab9e104ebe6.zip
uvcvideo: Reset the bytesused field when recycling an erroneous buffer
commit 8a3f0ede2b3f5477122060af1a816c6bbf09fcd2 upstream. 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. Signed-off-by: Jayakrishnan Memana <jayakrishnan.memana@maxim-ic.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/video/uvc/uvc_queue.c1
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 8f54e24e3f3..4261bf23193 100644
--- a/drivers/media/video/uvc/uvc_queue.c
+++ b/drivers/media/video/uvc/uvc_queue.c
@@ -355,6 +355,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;
}