]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/usb-gadget-net2272-fix-net2272_dequeue.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / usb-gadget-net2272-fix-net2272_dequeue.patch
CommitLineData
dcd32332
SL
1From 7adf2316b536a8827fe3880f48c5432d8fe731f2 Mon Sep 17 00:00:00 2001
2From: Guido Kiener <guido@kiener-muenchen.de>
3Date: Mon, 18 Mar 2019 09:18:34 +0100
4Subject: usb: gadget: net2272: Fix net2272_dequeue()
5
6[ Upstream commit 091dacc3cc10979ab0422f0a9f7fcc27eee97e69 ]
7
8Restore the status of ep->stopped in function net2272_dequeue().
9
10When the given request is not found in the endpoint queue
11the function returns -EINVAL without restoring the state of
12ep->stopped. Thus the endpoint keeps blocked and does not transfer
13any data anymore.
14
15This fix is only compile-tested, since we do not have a
16corresponding hardware. An analogous fix was tested in the sibling
17driver. See "usb: gadget: net2280: Fix net2280_dequeue()"
18
19Acked-by: Alan Stern <stern@rowland.harvard.edu>
20Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com>
21Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
22Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
23---
24 drivers/usb/gadget/udc/net2272.c | 1 +
25 1 file changed, 1 insertion(+)
26
27diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
28index 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--
402.19.1
41