usb: renesas_usbhs: gadget: fix giveback status code in usbhsg_pipe_disable()
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Thu, 3 Mar 2016 09:35:51 +0000 (18:35 +0900)
committerFelipe Balbi <balbi@kernel.org>
Fri, 4 Mar 2016 13:14:48 +0000 (15:14 +0200)
A udc driver should set the giveback status to -ESHUTDOWN in
usb_ep_disable(). Otherwise, a gadget driver (e.g. g_serial) might
request next data wrongly and it is possible to cause kernel panic.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/renesas_usbhs/mod_gadget.c

index 657f967..664b263 100644 (file)
@@ -561,7 +561,7 @@ static int usbhsg_pipe_disable(struct usbhsg_uep *uep)
                if (!pkt)
                        break;
 
-               usbhsg_queue_pop(uep, usbhsg_pkt_to_ureq(pkt), -ECONNRESET);
+               usbhsg_queue_pop(uep, usbhsg_pkt_to_ureq(pkt), -ESHUTDOWN);
        }
 
        usbhs_pipe_disable(pipe);