]>
Commit | Line | Data |
---|---|---|
dcd32332 SL |
1 | From 7adf2316b536a8827fe3880f48c5432d8fe731f2 Mon Sep 17 00:00:00 2001 |
2 | From: Guido Kiener <guido@kiener-muenchen.de> | |
3 | Date: Mon, 18 Mar 2019 09:18:34 +0100 | |
4 | Subject: usb: gadget: net2272: Fix net2272_dequeue() | |
5 | ||
6 | [ Upstream commit 091dacc3cc10979ab0422f0a9f7fcc27eee97e69 ] | |
7 | ||
8 | Restore the status of ep->stopped in function net2272_dequeue(). | |
9 | ||
10 | When the given request is not found in the endpoint queue | |
11 | the function returns -EINVAL without restoring the state of | |
12 | ep->stopped. Thus the endpoint keeps blocked and does not transfer | |
13 | any data anymore. | |
14 | ||
15 | This fix is only compile-tested, since we do not have a | |
16 | corresponding hardware. An analogous fix was tested in the sibling | |
17 | driver. See "usb: gadget: net2280: Fix net2280_dequeue()" | |
18 | ||
19 | Acked-by: Alan Stern <stern@rowland.harvard.edu> | |
20 | Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com> | |
21 | Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> | |
22 | Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org> | |
23 | --- | |
24 | drivers/usb/gadget/udc/net2272.c | 1 + | |
25 | 1 file changed, 1 insertion(+) | |
26 | ||
27 | diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c | |
28 | index 3b6e34fc032b..553922c3be85 100644 | |
29 | --- a/drivers/usb/gadget/udc/net2272.c | |
30 | +++ b/drivers/usb/gadget/udc/net2272.c | |
31 | @@ -962,6 +962,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |
32 | break; | |
33 | } | |
34 | if (&req->req != _req) { | |
35 | + ep->stopped = stopped; | |
36 | spin_unlock_irqrestore(&ep->dev->lock, flags); | |
37 | return -EINVAL; | |
38 | } | |
39 | -- | |
40 | 2.19.1 | |
41 |