Skip to content

Commit 87ce177

Browse files
ribaldamchehab
authored andcommitted
media: uvcvideo: Propagate buf->error to userspace
Now we return VB2_BUF_STATE_DONE for valid and invalid frames. Propagate the correct value, so the user can know if the frame is valid or not via struct v4l2_buffer->flags. Reported-by: Hans de Goede <[email protected]> Closes: https://lore.kernel.org/linux-media/[email protected] Fixes: 6998b6f ("[media] uvcvideo: Use videobuf2-vmalloc") Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent d6b874f commit 87ce177

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/media/usb/uvc/uvc_queue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ static void uvc_queue_buffer_complete(struct kref *ref)
479479

480480
buf->state = buf->error ? UVC_BUF_STATE_ERROR : UVC_BUF_STATE_DONE;
481481
vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused);
482-
vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
482+
vb2_buffer_done(&buf->buf.vb2_buf, buf->error ? VB2_BUF_STATE_ERROR :
483+
VB2_BUF_STATE_DONE);
483484
}
484485

485486
/*

0 commit comments

Comments
 (0)