usb: gadget: uvc: improve sg exit condition
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Sat, 2 Apr 2022 23:27:44 +0000 (01:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:12:53 +0000 (10:12 +0200)
commit738515cf8bb48c6a1a8a59db140bd226a4c5a70a
tree3e91dc4a5e63179ddfdc702d5a0f198d4f1fd279
parentdb11d8c72a5d8e740329f0fb4a626415598249f7
usb: gadget: uvc: improve sg exit condition

commit aef11279888c00e1841a3533a35d279285af3a51 upstream.

The exit condition to quit iterating over the sg_list, while encoding
the sg entries, has to consider the case that the dma_len of the entry
could be zero. This patch takes this condition to account.

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