Skip to content

Commit 6477927

Browse files
committed
media: uvcvideo: Propagate buf->error to userspace
jira LE-3622 Rebuild_History Non-Buildable kernel-6.12.0-55.22.1.el10_0 commit-author Ricardo Ribalda <ribalda@chromium.org> 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 <hdegoede@redhat.com> Closes: https://lore.kernel.org/linux-media/84b0f212-cd88-46bb-8e6f-b94ec3eccba6@redhat.com Fixes: 6998b6f ("[media] uvcvideo: Use videobuf2-vmalloc") Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20241218-uvc-deprecate-v2-1-ab814139e983@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> (cherry picked from commit 87ce177) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 683b4db commit 6477927

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)