From c3e08bc4f55d44566a1e62f78fe8810c00774d9a Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Mon, 29 Mar 2004 22:10:36 -0800 Subject: [PATCH] [PATCH] USB: ftdi_sio.c: not unlinking urb on ftdi_close This patch fixes a bug in ftdi_sio.c where the driver wouldn't unlink the read urb if the user application cleared the HUPCL flag on termios->c_cflag. --- drivers/usb/serial/ftdi_sio.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 44f29ccad522e..85264c56e2e30 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1361,15 +1361,16 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp) /* drop RTS */ if (set_rts(port, LOW) < 0) { err("Error from RTS LOW urb"); - } - /* shutdown our bulk read */ - if (port->read_urb) { - usb_unlink_urb (port->read_urb); } - /* unlink the running write urbs */ - + } /* Note change no line if hupcl is off */ + + /* shutdown our bulk read */ + if (port->read_urb) { + if (usb_unlink_urb (port->read_urb) < 0) { + err("Error unlinking read urb"); + } + } - } /* Note change no line is hupcl is off */ } /* if (serial->dev) */ -- 2.53.0