Skip to content

Commit

Permalink
USB: serial/kobil_sct, fix potential tty NULL dereference
Browse files Browse the repository at this point in the history
Make sure that we check the return value of tty_port_tty_get.
Sometimes it may return NULL and we later dereference that.

The only place here is in kobil_read_int_callback, so fix it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Mar 1, 2011
1 parent f7d7aed commit 6960f40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/serial/kobil_sct.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static void kobil_read_int_callback(struct urb *urb)
}

tty = tty_port_tty_get(&port->port);
if (urb->actual_length) {
if (tty && urb->actual_length) {

/* BEGIN DEBUG */
/*
Expand Down

0 comments on commit 6960f40

Please sign in to comment.