]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: dwc3: gadget: always cleanup all TRBs
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 10 Aug 2016 09:35:30 +0000 (12:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Sep 2016 06:34:46 +0000 (08:34 +0200)
commit 7c705dfe2ebe731c8fd068623b6b4df2d3512c08 upstream.

If we stop earlier due to short packet, we will
not be able to giveback all TRBs.

Cc: Brian E Rogers <brian.e.rogers@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c

index 5a655b231af9068598953ab73b96241f871aa242..05a5300aa1ab0927006331bb032e6b14cb4990b2 100644 (file)
@@ -1969,7 +1969,7 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep,
                        s_pkt = 1;
        }
 
-       if (s_pkt)
+       if (s_pkt && !chain)
                return 1;
        if ((event->status & DEPEVT_STATUS_LST) &&
                        (trb->ctrl & (DWC3_TRB_CTRL_LST |