Commit 62ad296b authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

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: default avatarOliver Neukum <oneukum@suse.de>
Cc: Stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 17d80d56
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -283,7 +283,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
	}

	if (port->open_count == 0) {
		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);
	}