summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cp2101.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/cp2101.c')
-rw-r--r--drivers/usb/serial/cp2101.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index cd5f71b7f63..f3ca66017a0 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);
}
/*