mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
usb: renesas_usbhs: gadget: fix unused-but-set-variable warning
commitb7d44c36a6upstream. The commitb8b9c974af("usb: renesas_usbhs: gadget: disable all eps when the driver stops") causes the unused-but-set-variable warning. But, if the usbhsg_ep_disable() will return non-zero value, udc/core.c doesn't clear the ep->enabled flag. So, this driver should not return non-zero value, if the pipe is zero because this means the pipe is already disabled. Otherwise, the ep->enabled flag is never cleared when the usbhsg_ep_disable() is called by the renesas_usbhs driver first. Fixes:b8b9c974af("usb: renesas_usbhs: gadget: disable all eps when the driver stops") Fixes:11432050f0("usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e86206bd87
commit
4104b44e5d
@@ -641,14 +641,11 @@ static int usbhsg_ep_disable(struct usb_ep *ep)
|
||||
struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
|
||||
struct usbhs_pipe *pipe;
|
||||
unsigned long flags;
|
||||
int ret = 0;
|
||||
|
||||
spin_lock_irqsave(&uep->lock, flags);
|
||||
pipe = usbhsg_uep_to_pipe(uep);
|
||||
if (!pipe) {
|
||||
ret = -EINVAL;
|
||||
if (!pipe)
|
||||
goto out;
|
||||
}
|
||||
|
||||
usbhsg_pipe_disable(uep);
|
||||
usbhs_pipe_free(pipe);
|
||||
|
||||
Reference in New Issue
Block a user