diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 3bcf33466587..353798631903 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -283,7 +283,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | if (port->open_count == 0) { | 285 | if (port->open_count == 0) { |
286 | usb_autopm_put_interface(port->serial->interface); | 286 | mutex_lock(&port->serial->disc_mutex); |
287 | if (!port->serial->disconnected) | ||
288 | usb_autopm_put_interface(port->serial->interface); | ||
289 | mutex_unlock(&port->serial->disc_mutex); | ||
287 | module_put(port->serial->type->driver.owner); | 290 | module_put(port->serial->type->driver.owner); |
288 | } | 291 | } |
289 | 292 | ||