]>
Commit | Line | Data |
---|---|---|
a1cbf3d1 GKH |
1 | From b7d44c36a6f6d956e1539e0dd42f98b26e5a4684 Mon Sep 17 00:00:00 2001 |
2 | From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | |
3 | Date: Fri, 28 Jul 2017 19:28:57 +0900 | |
4 | Subject: usb: renesas_usbhs: gadget: fix unused-but-set-variable warning | |
5 | ||
6 | From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | |
7 | ||
8 | commit b7d44c36a6f6d956e1539e0dd42f98b26e5a4684 upstream. | |
9 | ||
10 | The commit b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps | |
11 | when the driver stops") causes the unused-but-set-variable warning. | |
12 | But, if the usbhsg_ep_disable() will return non-zero value, udc/core.c | |
13 | doesn't clear the ep->enabled flag. So, this driver should not return | |
14 | non-zero value, if the pipe is zero because this means the pipe is | |
15 | already disabled. Otherwise, the ep->enabled flag is never cleared | |
16 | when the usbhsg_ep_disable() is called by the renesas_usbhs driver first. | |
17 | ||
18 | Fixes: b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver stops") | |
19 | Fixes: 11432050f070 ("usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()") | |
20 | Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | |
21 | Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> | |
22 | Signed-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); |