提交 fce4877a 编写于 作者: A Alan Cox 提交者: Linus Torvalds

tty: Fix USB kref leak

When we close we must clear the extra reference we got when we read
port->tty. Setting the port tty NULL will clear the kref held by the driver
but not the one we obtained ourselves while doing the lookup.
Signed-off-by: NAlan Cox <alan@redhat.com>
Tested-by: NHelge Hafting <helge.hafting@aitel.hist.no>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0fb7f4f0
......@@ -281,6 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
if (tty->driver_data)
tty->driver_data = NULL;
tty_port_tty_set(&port->port, NULL);
tty_kref_put(tty);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册