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/option.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/usb/serial/option.c') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index bbbe1b96200..5e8bf1bc1e5 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -641,7 +641,10 @@ static void option_close(struct usb_serial_port *port, struct file *filp) portdata->dtr_state = 0; if (serial->dev) { - option_send_setup(port); + mutex_lock(&serial->disc_mutex); + if (!serial->disconnected) + option_send_setup(port); + mutex_unlock(&serial->disc_mutex); /* Stop reading/writing urbs */ for (i = 0; i < N_IN_URB; i++) -- cgit v1.2.3