]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/usb-renesas_usbhs-gadget-fix-unused-but-set-variable-warning.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / usb-renesas_usbhs-gadget-fix-unused-but-set-variable-warning.patch
CommitLineData
a1cbf3d1
GKH
1From b7d44c36a6f6d956e1539e0dd42f98b26e5a4684 Mon Sep 17 00:00:00 2001
2From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
3Date: Fri, 28 Jul 2017 19:28:57 +0900
4Subject: usb: renesas_usbhs: gadget: fix unused-but-set-variable warning
5
6From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7
8commit b7d44c36a6f6d956e1539e0dd42f98b26e5a4684 upstream.
9
10The commit b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps
11when the driver stops") causes the unused-but-set-variable warning.
12But, if the usbhsg_ep_disable() will return non-zero value, udc/core.c
13doesn't clear the ep->enabled flag. So, this driver should not return
14non-zero value, if the pipe is zero because this means the pipe is
15already disabled. Otherwise, the ep->enabled flag is never cleared
16when the usbhsg_ep_disable() is called by the renesas_usbhs driver first.
17
18Fixes: b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver stops")
19Fixes: 11432050f070 ("usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()")
20Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
21Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 drivers/usb/renesas_usbhs/mod_gadget.c | 5 +----
26 1 file changed, 1 insertion(+), 4 deletions(-)
27
28--- a/drivers/usb/renesas_usbhs/mod_gadget.c
29+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
30@@ -641,14 +641,11 @@ static int usbhsg_ep_disable(struct usb_
31 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
32 struct usbhs_pipe *pipe;
33 unsigned long flags;
34- int ret = 0;
35
36 spin_lock_irqsave(&uep->lock, flags);
37 pipe = usbhsg_uep_to_pipe(uep);
38- if (!pipe) {
39- ret = -EINVAL;
40+ if (!pipe)
41 goto out;
42- }
43
44 usbhsg_pipe_disable(uep);
45 usbhs_pipe_free(pipe);