diff options
author | Olivier Blin <blino@mandriva.com> | 2008-08-08 12:01:11 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-08-14 04:43:45 -0400 |
commit | add477df674db00377d9a4dc0d9b553ce79bc06d (patch) | |
tree | 6b52bedf8a3c17ddb8259b717b68e6b6f759be2b | |
parent | 1595ab5d7d99bc6c9a5548ab3fb83e278eeae409 (diff) |
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: Olivier Blin <blino@mandriva.com>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Jari Tenhunen <jari.tenhunen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/usb/hso.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 031d07b105a..94a27f764e6 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -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); } |