diff options
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f03b136ecfce..8f65ab3a3b92 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -882,8 +882,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting) | |||
882 | 882 | ||
883 | if (i == (request->num_mapped_sgs - 1) || | 883 | if (i == (request->num_mapped_sgs - 1) || |
884 | sg_is_last(s)) { | 884 | sg_is_last(s)) { |
885 | if (list_is_last(&req->list, | 885 | if (list_empty(&dep->request_list)) |
886 | &dep->request_list)) | ||
887 | last_one = true; | 886 | last_one = true; |
888 | chain = false; | 887 | chain = false; |
889 | } | 888 | } |
@@ -901,6 +900,9 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting) | |||
901 | if (last_one) | 900 | if (last_one) |
902 | break; | 901 | break; |
903 | } | 902 | } |
903 | |||
904 | if (last_one) | ||
905 | break; | ||
904 | } else { | 906 | } else { |
905 | dma = req->request.dma; | 907 | dma = req->request.dma; |
906 | length = req->request.length; | 908 | length = req->request.length; |