diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-01-21 17:44:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 23:35:04 +0100 |
commit | e33fe4d86f91127f6f7d931ff59ed6cbda06e72b (patch) | |
tree | 7af352e8fc696220a06c6e2a9b9006a0ea5ee075 /drivers/usb/serial/whiteheat.c | |
parent | USB: fix memleak in ark3116 serial driver (diff) | |
download | linux-e33fe4d86f91127f6f7d931ff59ed6cbda06e72b.tar.xz linux-e33fe4d86f91127f6f7d931ff59ed6cbda06e72b.zip |
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 '')
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index f5033d482eee..38726ef3132b 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -658,11 +658,14 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp) struct list_head *tmp2; dbg("%s - port %d", __FUNCTION__, port->number); - + + mutex_lock(&port->serial->disc_mutex); /* filp is NULL when called from usb_serial_disconnect */ - if (filp && (tty_hung_up_p(filp))) { + if ((filp && (tty_hung_up_p(filp))) || port->serial->disconnected) { + mutex_unlock(&port->serial->disc_mutex); return; } + mutex_unlock(&port->serial->disc_mutex); port->tty->closing = 1; |