Commit 38f6cee3 authored by Guido Kiener's avatar Guido Kiener Committed by Khalid Elmously

usb: gadget: net2280: Fix net2280_dequeue()

BugLink: https://bugs.launchpad.net/bugs/1830176

[ Upstream commit f1d3fba1 ]

When a request must be dequeued with net2280_dequeue() e.g. due
to a device clear action and the same request is finished by the
function scan_dma_completions() then the function net2280_dequeue()
does not find the request in the following search loop and
returns the error -EINVAL without restoring the status ep->stopped.
Thus the endpoint keeps blocked and does not receive any data
anymore.
This fix restores the status and does not issue an error message.
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGuido Kiener <guido.kiener@rohde-schwarz.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarSasha Levin (Microsoft) <sashal@kernel.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 175140c5
...@@ -1270,9 +1270,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req) ...@@ -1270,9 +1270,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req)
break; break;
} }
if (&req->req != _req) { if (&req->req != _req) {
ep->stopped = stopped;
spin_unlock_irqrestore(&ep->dev->lock, flags); spin_unlock_irqrestore(&ep->dev->lock, flags);
dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n", ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);
__func__);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment