diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-01-22 13:56:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 14:35:05 -0800 |
commit | 95bef012ea4a3cce437a4fcf59bb097d14944b0d (patch) | |
tree | bc9991b335211030bcc2ee76fdc42ae2fcccb645 /drivers/usb/serial/cp2101.c | |
parent | e33fe4d86f91127f6f7d931ff59ed6cbda06e72b (diff) |
USB: more serial drivers writing after disconnect
this covers the rest of the obvious cases by using the flags
and locks to guard against disconnect which were introduced
in the earlier patch against mos7720.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/cp2101.c')
-rw-r--r-- | drivers/usb/serial/cp2101.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index cd5f71b7f637..f3ca66017a03 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c @@ -348,7 +348,10 @@ static void cp2101_close (struct usb_serial_port *port, struct file * filp) usb_kill_urb(port->write_urb); usb_kill_urb(port->read_urb); - cp2101_set_config_single(port, CP2101_UART, UART_DISABLE); + mutex_lock(&port->serial->disc_mutex); + if (!port->serial->disconnected) + cp2101_set_config_single(port, CP2101_UART, UART_DISABLE); + mutex_unlock(&port->serial->disc_mutex); } /* |