diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-01-21 11:44:10 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:35:04 -0500 |
commit | e33fe4d86f91127f6f7d931ff59ed6cbda06e72b (patch) | |
tree | 7af352e8fc696220a06c6e2a9b9006a0ea5ee075 /drivers/usb/serial/option.c | |
parent | 004b4f2d4448cff7f13871c05d744b00a7c74d4a (diff) |
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 <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index bbbe1b962008..5e8bf1bc1e50 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) | |||
641 | portdata->dtr_state = 0; | 641 | portdata->dtr_state = 0; |
642 | 642 | ||
643 | if (serial->dev) { | 643 | if (serial->dev) { |
644 | option_send_setup(port); | 644 | mutex_lock(&serial->disc_mutex); |
645 | if (!serial->disconnected) | ||
646 | option_send_setup(port); | ||
647 | mutex_unlock(&serial->disc_mutex); | ||
645 | 648 | ||
646 | /* Stop reading/writing urbs */ | 649 | /* Stop reading/writing urbs */ |
647 | for (i = 0; i < N_IN_URB; i++) | 650 | for (i = 0; i < N_IN_URB; i++) |