usb: gadget: uvc: giveback vb2 buffer on req complete
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Sat, 2 Apr 2022 23:27:43 +0000 (01:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:12:53 +0000 (10:12 +0200)
commitdb11d8c72a5d8e740329f0fb4a626415598249f7
tree63735b445203bed4d0252c4c6d599c6f7ed3fc64
parentaee340dccf5a09a4a346db7a46cef6cf26cb48fa
usb: gadget: uvc: giveback vb2 buffer on req complete

commit 9b969f93bcef9b3d9e92f1810e22bbd6c344a0e5 upstream.

On uvc_video_encode_isoc_sg the mapped vb2 buffer is returned
to early. Only after the last usb_request worked with the buffer
it is allowed to give it back to vb2. This patch fixes that.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220402232744.3622565-3-m.grzeschik@pengutronix.de
Cc: Dan Vacura <w36195@motorola.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/uvc.h
drivers/usb/gadget/function/uvc_queue.c
drivers/usb/gadget/function/uvc_video.c