usb: gadget: uvc: fix sg handling during video encode
authorJeff Vanhoof <qjv001@motorola.com>
Tue, 18 Oct 2022 21:50:40 +0000 (16:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:59:11 +0000 (23:59 +0900)
commitf2f53be61714fe2bf426a58f60f1526311c9a201
tree469a4ff7c4e8114b87a29ead33008e191442bf4f
parent80ff4ef777374188377abdff9623878b89edf287
usb: gadget: uvc: fix sg handling during video encode

commit b57b08e6f431348363adffa5b6643fe3ec9dc7fe upstream.

In uvc_video_encode_isoc_sg, the uvc_request's sg list is
incorrectly being populated leading to corrupt video being
received by the remote end. When building the sg list the
usage of buf->sg's 'dma_length' field is not correct and
instead its 'length' field should be used.

Fixes: e81e7f9a0eb9 ("usb: gadget: uvc: add scatter gather support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jeff Vanhoof <qjv001@motorola.com>
Signed-off-by: Dan Vacura <w36195@motorola.com>
Link: https://lore.kernel.org/r/20221018215044.765044-5-w36195@motorola.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/uvc_video.c