Skip to content

Commit

Permalink
USB: mxuport: fix null deref when used as a console
Browse files Browse the repository at this point in the history
Fix null-pointer dereference at probe when the device is used as a
console, in which case the tty argument to open will be NULL.

Fixes: ee467a1 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX
driver")
Cc: stable <stable@vger.kernel.org>	# v3.14
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Greg Kroah-Hartman <greg@kroah.com>
  • Loading branch information
Johan Hovold committed Feb 26, 2015
1 parent d6f7f41 commit db81de7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/serial/mxuport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,8 @@ static int mxuport_open(struct tty_struct *tty, struct usb_serial_port *port)
}

/* Initial port termios */
mxuport_set_termios(tty, port, NULL);
if (tty)
mxuport_set_termios(tty, port, NULL);

/*
* TODO: use RQ_VENDOR_GET_MSR, once we know what it
Expand Down

0 comments on commit db81de7

Please sign in to comment.