Skip to content

Commit e276681

Browse files
committed
media: uvcvideo: Propagate buf->error to userspace
jira LE-3615 Rebuild_History Non-Buildable kernel-5.14.0-570.28.1.el9_6 commit-author Ricardo Ribalda <[email protected]> commit 87ce177 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]> (cherry picked from commit 87ce177) Signed-off-by: Jonathan Maple <[email protected]>
1 parent e3a4f64 commit e276681

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
@@ -483,7 +483,8 @@ static void uvc_queue_buffer_complete(struct kref *ref)
483483

484484
buf->state = buf->error ? UVC_BUF_STATE_ERROR : UVC_BUF_STATE_DONE;
485485
vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused);
486-
vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE);
486+
vb2_buffer_done(&buf->buf.vb2_buf, buf->error ? VB2_BUF_STATE_ERROR :
487+
VB2_BUF_STATE_DONE);
487488
}
488489

489490
/*

0 commit comments

Comments
 (0)