usb: dwc3: gadget: Check MPS of the request length
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 24 Sep 2020 08:21:18 +0000 (01:21 -0700)
committerFelipe Balbi <balbi@kernel.org>
Fri, 2 Oct 2020 06:57:44 +0000 (09:57 +0300)
commitca3df3468eec87f6374662f7de425bc44c3810c1
tree2bc430fb03516e115568d938e7d1bd8ffec9a3c7
parent5b35dd1a5a666329192a9616ec21098591259058
usb: dwc3: gadget: Check MPS of the request length

When preparing for SG, not all the entries are prepared at once. When
resume, don't use the remaining request length to calculate for MPS
alignment. Use the entire request->length to do that.

Cc: stable@vger.kernel.org
Fixes: 5d187c0454ef ("usb: dwc3: gadget: Don't setup more than requested")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c