提交 62ad296b 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

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: NOliver Neukum <oneukum@suse.de>
Cc: Stable <stable@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 17d80d56
...@@ -283,7 +283,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp) ...@@ -283,7 +283,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
} }
if (port->open_count == 0) { 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); module_put(port->serial->type->driver.owner);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册