]> err.no Git - linux-2.6/commitdiff
hso: fix oops in read/write callbacks
authorOlivier Blin <blino@mandriva.com>
Fri, 8 Aug 2008 19:01:11 +0000 (12:01 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 14 Aug 2008 08:43:45 +0000 (04:43 -0400)
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>
drivers/net/usb/hso.c

index 031d07b105af1f3f9716d083d8edba60a971e1de..94a27f764e6b22285ede5e50217a15e779b4072b 100644 (file)
@@ -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);
        }