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

hso: fix oops in read/write callbacks

The tty may be closed already when the read/write callbacks are called.
This patch checks that the ttys still exist before waking them up.
Signed-off-by: NOlivier Blin <blino@mandriva.com>
Acked-by: NAlan Cox <alan@redhat.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>
上级 1595ab5d
......@@ -1467,7 +1467,8 @@ static void hso_std_serial_write_bulk_callback(struct urb *urb)
return;
}
hso_put_activity(serial->parent);
tty_wakeup(serial->tty);
if (serial->tty)
tty_wakeup(serial->tty);
hso_kick_transmit(serial);
D1(" ");
......@@ -1538,7 +1539,8 @@ static void ctrl_callback(struct urb *urb)
clear_bit(HSO_SERIAL_FLAG_RX_SENT, &serial->flags);
} else {
hso_put_activity(serial->parent);
tty_wakeup(serial->tty);
if (serial->tty)
tty_wakeup(serial->tty);
/* response to a write command */
hso_kick_transmit(serial);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册