From e33fe4d86f91127f6f7d931ff59ed6cbda06e72b Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 21 Jan 2008 17:44:10 +0100 Subject: USB: make sure usb serial drivers don't flush to logically disconnected devices If disconnect() is called for a logical disconnect, no more IO must be done after disconnect() returns, or the old and new drivers may conflict. This patch avoids this by using the flag and lock introduced by the earlier patch for the mos7720 driver. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/sierra.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/usb/serial/sierra.c') diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 953bdf8827d2..4c925e3e8a63 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -597,7 +597,10 @@ static void sierra_close(struct usb_serial_port *port, struct file *filp) portdata->dtr_state = 0; if (serial->dev) { - sierra_send_setup(port); + mutex_lock(&serial->disc_mutex); + if (!serial->disconnected) + sierra_send_setup(port); + mutex_unlock(&serial->disc_mutex); /* Stop reading/writing urbs */ for (i = 0; i < N_IN_URB; i++) -- cgit v1.2.2