From 086a76a2d612ae6ac74ca2189ed8b222e2432daf Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 14 Mar 2023 15:25:17 +0100 Subject: usb: gadget: u_serial: Put back to list if shutdown We have to put the requests back to the read pool, even if they are shut down, otherwise they are lost. Signed-off-by: Sascha Hauer --- drivers/usb/gadget/function/u_serial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index ac7a0b589d..ca4e77c5ff 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -155,12 +155,13 @@ static void gs_read_complete(struct usb_ep *ep, struct usb_request *req) { struct gs_port *port = ep->driver_data; + list_add_tail(&req->list, &port->read_pool); + port->read_nb_queued--; + if (req->status == -ESHUTDOWN) return; kfifo_put(port->recv_fifo, req->buf, req->actual); - list_add_tail(&req->list, &port->read_pool); - port->read_nb_queued--; gs_start_rx(port); } -- cgit v1.2.1