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>
This commit is contained in:
Oliver Neukum
2008-01-21 17:44:10 +01:00
committed by Greg Kroah-Hartman
parent 004b4f2d44
commit e33fe4d86f
5 changed files with 35 additions and 21 deletions

View File

@ -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++)