Skip to content

Commit

Permalink
USB: fix usb serial pm counter decrement for disconnected interfaces
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 17d80d5 commit 62ad296
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
}

if (port->open_count == 0) {
usb_autopm_put_interface(port->serial->interface);
mutex_lock(&port->serial->disc_mutex);
if (!port->serial->disconnected)
usb_autopm_put_interface(port->serial->interface);
mutex_unlock(&port->serial->disc_mutex);
module_put(port->serial->type->driver.owner);
}

Expand Down

0 comments on commit 62ad296

Please sign in to comment.