提交 6d558a52 编写于 作者: O Olivier Blin 提交者: Jeff Garzik

hso: fix refcounting on the ttyHSx devices

The references on ttyHSx devices were not decremented correctly when
the tty was closed. The helper freeing the serial devices was never
called because of that, and the module left some dangling sysfs
devices after being unloaded.
Signed-off-by: NOlivier Blin <blino@mandriva.com>
Cc: Jari Tenhunen <jari.tenhunen@iki.fi>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 add477df
......@@ -1103,8 +1103,8 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
/* reset the rts and dtr */
/* do the actual close */
serial->open_count--;
if (serial->open_count <= 0) {
kref_put(&serial->parent->ref, hso_serial_ref_free);
if (serial->open_count <= 0) {
serial->open_count = 0;
if (serial->tty) {
serial->tty->driver_data = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册