Skip to content

Commit

Permalink
hso: fix oops in read/write callbacks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Olivier Blin authored and Jeff Garzik committed Aug 14, 2008
1 parent 1595ab5 commit add477d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ");
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit add477d

Please sign in to comment.