On success, VIDIOC_REQBUFS should return 0, not the number of allocated buffers. As uvcg_alloc_buffers() is directly called by regbufs, it has to return the correct error codes. Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx> --- drivers/usb/gadget/function/uvc_queue.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c index 0aa3d7e1f3cc..f14f75b93aaa 100644 --- a/drivers/usb/gadget/function/uvc_queue.c +++ b/drivers/usb/gadget/function/uvc_queue.c @@ -179,11 +179,7 @@ void uvcg_free_buffers(struct uvc_video_queue *queue) int uvcg_alloc_buffers(struct uvc_video_queue *queue, struct v4l2_requestbuffers *rb) { - int ret; - - ret = vb2_reqbufs(&queue->queue, rb); - - return ret ? ret : rb->count; + return vb2_reqbufs(&queue->queue, rb); } int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) -- 2.30.2