USB: keyspan: Fix oops
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Thu, 3 Jan 2008 16:59:04 +0000 (16:59 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Feb 2008 22:34:42 +0000 (14:34 -0800)
If we get a data URB back from the hardware after we have put the tty to
bed we go kaboom. Fortunately all we need to do is process the URB
without trying to ram its contents down the throat of an ex-tty.

Cc: stable <stable@kernel.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/keyspan.c

index 7c069a02c1dd40817d93b58dffed4217bd740ff2..ea7bba69f4da129397e111463a0ec13995d0ac5a 100644 (file)
@@ -838,7 +838,7 @@ static void usa49_indat_callback(struct urb *urb)
 
        port = (struct usb_serial_port *) urb->context;
        tty = port->tty;
-       if (urb->actual_length) {
+       if (tty && urb->actual_length) {
                /* 0x80 bit is error flag */
                if ((data[0] & 0x80) == 0) {
                        /* no error on any byte */