summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorTejas Joglekar <Tejas.Joglekar@synopsys.com>2019-11-13 11:45:16 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-17 19:55:57 +0100
commita7f7e61270f1676517c2f6f2903317f77f122f15 (patch)
tree60faabd6d55d5364aeff1376756c5083ede5f9c9 /drivers/usb/dwc3/gadget.c
parent1dcdfe49066835aa08e31570cf64223f28cb6ed0 (diff)
downloadlinux-stable-a7f7e61270f1676517c2f6f2903317f77f122f15.tar.gz
linux-stable-a7f7e61270f1676517c2f6f2903317f77f122f15.tar.bz2
linux-stable-a7f7e61270f1676517c2f6f2903317f77f122f15.zip
usb: dwc3: gadget: Fix logical condition
commit 8c7d4b7b3d43c54c0b8c1e4adb917a151c754196 upstream. This patch corrects the condition to kick the transfer without giving back the requests when either request has remaining data or when there are pending SGs. The && check was introduced during spliting up the dwc3_gadget_ep_cleanup_completed_requests() function. Fixes: f38e35dd84e2 ("usb: dwc3: gadget: split dwc3_gadget_ep_cleanup_completed_requests()") Cc: stable@vger.kernel.org Signed-off-by: Tejas Joglekar <joglekar@synopsys.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a9aba716bf80..6ff6ee4fe5aa 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2491,7 +2491,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
req->request.actual = req->request.length - req->remaining;
- if (!dwc3_gadget_ep_request_completed(req) &&
+ if (!dwc3_gadget_ep_request_completed(req) ||
req->num_pending_sgs) {
__dwc3_gadget_kick_transfer(dep);
goto out;