Re: [PATCH 2/8] usb: gadget: uvc: fix return code of REQBUFS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michael

On 23/03/2023 11:41, Michael Tretter wrote:
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.


s/regbufs/reqbufs


Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
---


This probably wants a Fixes: tag?


Reviewed-by: Daniel Scally <dan.scally@xxxxxxxxxxxxxxxx>

  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)




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux