diff options
author | Thinh Nguyen | 2019-02-13 04:39:27 +0100 |
---|---|---|
committer | Felipe Balbi | 2019-02-13 12:02:39 +0100 |
commit | c7152763f02e05567da27462b2277a554e507c89 (patch) | |
tree | 54dca2a67053a52c399550685fd8f795124be1c5 /drivers/usb/dwc3 | |
parent | usb: dwc3: gadget: don't enable interrupt when disabling endpoint (diff) | |
download | kernel-qcow2-linux-c7152763f02e05567da27462b2277a554e507c89.tar.gz kernel-qcow2-linux-c7152763f02e05567da27462b2277a554e507c89.tar.xz kernel-qcow2-linux-c7152763f02e05567da27462b2277a554e507c89.zip |
usb: dwc3: Reset num_trbs after skipping
Currently req->num_trbs is not reset after the TRBs are skipped and
processed from the cancelled list. The gadget driver may reuse the
request with an invalid req->num_trbs, and DWC3 will incorrectly skip
trbs. To fix this, simply reset req->num_trbs to 0 after skipping
through all of them.
Fixes: c3acd5901414 ("usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b63aa1874727..f2d7b744def3 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1503,6 +1503,8 @@ static void dwc3_gadget_ep_skip_trbs(struct dwc3_ep *dep, struct dwc3_request *r trb->ctrl &= ~DWC3_TRB_CTRL_HWO; dwc3_ep_inc_deq(dep); } + + req->num_trbs = 0; } static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep) |