usb: dwc3: gadget: Wrap around when skip TRBs
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 5 Mar 2020 21:24:01 +0000 (13:24 -0800)
committerFelipe Balbi <balbi@kernel.org>
Sun, 15 Mar 2020 09:22:51 +0000 (11:22 +0200)
commit2dedea035ae82c5af0595637a6eda4655532b21e
tree21b169e45bee3c4d674bc09e3e65141471fadb01
parenta114c4ca64bd522aec1790c7e5c60c882f699d8f
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 <stable@vger.kernel.org>
Fixes: 7746a8dfb3f9 ("usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c