[PATCH 17/18] usb: gadget: u_serial: Put back to list if shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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);
 }
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux