[ 3.5.yuz extended stable ] Patch "USB: quatech2: fix io after disconnect" has been added to staging queue

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Thu Nov 22 04:49:36 UTC 2012

This is a note to let you know that I have just added a patch titled

    USB: quatech2: fix io after disconnect

to the linux-3.5.y-queue branch of the 3.5.yuz extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.yuz tree, see



>From 404f6d62cb97649034c03cc8d634ed2fe2d9c5c7 Mon Sep 17 00:00:00 2001
From: Johan Hovold <jhovold at gmail.com>
Date: Thu, 25 Oct 2012 10:29:10 +0200
Subject: [PATCH] USB: quatech2: fix io after disconnect

commit 2f0295adf6438188c4cd0868f2b1976a2b034e1d upstream.

Make sure no control urb is submitted during close after a disconnect by
checking the disconnected flag.

Signed-off-by: Johan Hovold <jhovold at gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
 drivers/usb/serial/quatech2.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index d170271..09d736a 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -434,6 +434,12 @@ static void qt2_close(struct usb_serial_port *port)
 	port_priv->urb_in_use = false;
 	spin_unlock_irqrestore(&port_priv->urb_lock, flags);

+	mutex_lock(&port->serial->disc_mutex);
+	if (port->serial->disconnected) {
+		mutex_unlock(&port->serial->disc_mutex);
+		return;
+	}
 	/* flush the port transmit buffer */
 	i = usb_control_msg(serial->dev,
 			    usb_rcvctrlpipe(serial->dev, 0),
@@ -465,6 +471,7 @@ static void qt2_close(struct usb_serial_port *port)
 		dev_err(&port->dev, "%s - close port failed %i\n",
 			__func__, i);

+	mutex_unlock(&port->serial->disc_mutex);

 static void qt2_disconnect(struct usb_serial *serial)

More information about the kernel-team mailing list