Browse Source

keyspan: fix oops

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.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@akpm@linux-foundation.org>
Alan Cox 17 years ago
parent
commit
a5569a565f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/serial/keyspan.c

+ 1 - 1
drivers/usb/serial/keyspan.c

@@ -447,7 +447,7 @@ static void	usa26_indat_callback(struct urb *urb)
 
 
 	port = (struct usb_serial_port *) urb->context;
 	port = (struct usb_serial_port *) urb->context;
 	tty = port->tty;
 	tty = port->tty;
-	if (urb->actual_length) {
+	if (tty && urb->actual_length) {
 		/* 0x80 bit is error flag */
 		/* 0x80 bit is error flag */
 		if ((data[0] & 0x80) == 0) {
 		if ((data[0] & 0x80) == 0) {
 			/* no errors on individual bytes, only possible overrun err*/
 			/* no errors on individual bytes, only possible overrun err*/