diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 16484060a24c75e9c2dc55b6bc876b01f75e2bf3..dba15e07fbd21fe74e2629b5527fbafeae2ca8a4 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -557,14 +557,16 @@ static int usbhsg_pipe_disable(struct usbhsg_uep *uep) struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); struct usbhs_pkt *pkt; - usbhs_pipe_disable(pipe); - while (1) { pkt = usbhs_pkt_pop(pipe, NULL); if (!pkt) break; + + usbhsg_queue_pop(uep, usbhsg_pkt_to_ureq(pkt), -ECONNRESET); } + usbhs_pipe_disable(pipe); + return 0; }