mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 05:48:40 +00:00
usb: gadget: uvc: improve sg exit condition
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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9b969f93bc
commit
aef1127988
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ uvc_video_encode_isoc_sg(struct usb_request *req, struct uvc_video *video,
|
|||
sg = sg_next(sg);
|
||||
|
||||
for_each_sg(sg, iter, ureq->sgt.nents - 1, i) {
|
||||
if (!len || !buf->sg)
|
||||
if (!len || !buf->sg || !sg_dma_len(buf->sg))
|
||||
break;
|
||||
|
||||
sg_left = sg_dma_len(buf->sg) - buf->offset;
|
||||
|
|
Loading…
Reference in a new issue