diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-06-25 07:32:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:16:36 -0400 |
commit | 62ad296b6ca78bd123864c138814c0a597873693 (patch) | |
tree | 7552b0330b2b4b39a92b84394346175d56fdd858 /drivers | |
parent | 17d80d562fd78a035e994afde88f354973e76236 (diff) |
USB: fix usb serial pm counter decrement for disconnected interfaces
usb serial decrements the pm counter even if an interface has been
disconnected. If it was a logical disconnect the interface may belong
already to another driver. This patch introduces a check for disconnected
interfaces.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: Stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 | ||