[ 062/101] USB: quatech2: fix io after disconnect

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold 

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 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/usb/serial/quatech2.c |7 +++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -429,6 +429,12 @@ static void qt2_close(struct usb_serial_
port_priv->urb_in_use = false;
spin_unlock_irqrestore(_priv->urb_lock, flags);
 
+   mutex_lock(>serial->disc_mutex);
+   if (port->serial->disconnected) {
+   mutex_unlock(>serial->disc_mutex);
+   return;
+   }
+
/* flush the port transmit buffer */
i = usb_control_msg(serial->dev,
usb_rcvctrlpipe(serial->dev, 0),
@@ -460,6 +466,7 @@ static void qt2_close(struct usb_serial_
dev_err(>dev, "%s - close port failed %i\n",
__func__, i);
 
+   mutex_unlock(>serial->disc_mutex);
 }
 
 static void qt2_disconnect(struct usb_serial *serial)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 062/101] USB: quatech2: fix io after disconnect

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

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 jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/quatech2.c |7 +++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -429,6 +429,12 @@ static void qt2_close(struct usb_serial_
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),
@@ -460,6 +466,7 @@ static void qt2_close(struct usb_serial_
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)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/