mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
[media] 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
8762541f06
commit
8a3f0ede2b
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user