Commit 985588fe authored by Johan Hovold's avatar Johan Hovold Committed by Luis Henriques

USB: mxuport: fix null deref when used as a console

commit db81de76 upstream.

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: ee467a1f ("USB: serial: add Moxa UPORT 12XX/14XX/16XX
driver")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Acked-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent ca6ba06a
...@@ -1284,7 +1284,8 @@ static int mxuport_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -1284,7 +1284,8 @@ static int mxuport_open(struct tty_struct *tty, struct usb_serial_port *port)
} }
/* Initial port termios */ /* 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 * TODO: use RQ_VENDOR_GET_MSR, once we know what it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment