Commit 55249e0b authored by Dan Vacura's avatar Dan Vacura
Browse files

FROMGIT: usb: gadget: uvc: fix sg handling in error case



If there is a transmission error the buffer will be returned too early,
causing a memory fault as subsequent requests for that buffer are still
queued up to be sent. Refactor the error handling to wait for the final
request to come in before reporting back the buffer to userspace for all
transfer types (bulk/isoc/isoc_sg). This ensures userspace knows if the
frame was successfully sent.

Fixes: e81e7f9a ("usb: gadget: uvc: add scatter gather support")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarDan Vacura <w36195@motorola.com>
Link: https://lore.kernel.org/r/20221018215044.765044-4-w36195@motorola.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 249635012
(cherry picked from commit 0a0a2760
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git

 usb-linus)
Change-Id: Ib69f1bcb25f3c92d851c0ed54a6e84555ee437ea
Signed-off-by: default avatarDan Vacura <w36195@motorola.com>
parent 45238b84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment