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
vanhempi 004b4f2d44
commit e33fe4d86f
5 muutettua tiedostoa jossa 35 lisäystä ja 21 poistoa

Näytä tiedosto

@@ -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;