diff options
| author | Thinh Nguyen <[email protected]> | 2020-03-05 13:24:01 -0800 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2020-03-15 11:22:51 +0200 |
| commit | 2dedea035ae82c5af0595637a6eda4655532b21e (patch) | |
| tree | 21b169e45bee3c4d674bc09e3e65141471fadb01 | |
| parent | a114c4ca64bd522aec1790c7e5c60c882f699d8f (diff) | |
usb: dwc3: gadget: Wrap around when skip TRBs
When skipping TRBs, we need to account for wrapping around the ring
buffer and not modifying some invalid TRBs. Without this fix, dwc3 won't
be able to check for available TRBs.
Cc: stable <[email protected]>
Fixes: 7746a8dfb3f9 ("usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()")
Signed-off-by: Thinh Nguyen <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
| -rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b032e62fff0f..4d3c79d90a6e 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1521,7 +1521,7 @@ static void dwc3_gadget_ep_skip_trbs(struct dwc3_ep *dep, struct dwc3_request *r for (i = 0; i < req->num_trbs; i++) { struct dwc3_trb *trb; - trb = req->trb + i; + trb = &dep->trb_pool[dep->trb_dequeue]; trb->ctrl &= ~DWC3_TRB_CTRL_HWO; dwc3_ep_inc_deq(dep); } |