summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-03-14 15:25:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-03-24 15:16:10 +0100
commit086a76a2d612ae6ac74ca2189ed8b222e2432daf (patch)
tree22ea2184f811823cd53f955e6f92557d514bf182 /drivers
parentb224f33f0a5d3fee8ffa0bb6e97d9e4262d52697 (diff)
downloadbarebox-086a76a2d612ae6ac74ca2189ed8b222e2432daf.tar.gz
barebox-086a76a2d612ae6ac74ca2189ed8b222e2432daf.tar.xz
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/function/u_serial.c5
1 files 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);
}