diff options
author | Johan Hovold <johan@kernel.org> | 2015-02-18 11:51:07 +0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 13:31:28 +0100 |
commit | 234d51b8f52c94568fde657f1a24f2f69db07420 (patch) | |
tree | 43634f5877d4d6c01a8fe05ee312a54339c4f918 /drivers | |
parent | 83d29ea1fb6d53a3c4d3377cc30093a31acecc38 (diff) | |
download | lwn-234d51b8f52c94568fde657f1a24f2f69db07420.tar.gz lwn-234d51b8f52c94568fde657f1a24f2f69db07420.zip |
USB: mxuport: fix null deref when used as a console
commit db81de767e375743ebb0ad2bcad3326962c2b67e 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: ee467a1f2066 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX
driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/mxuport.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c index ab1d690274ae..460a40669967 100644 --- a/drivers/usb/serial/mxuport.c +++ b/drivers/usb/serial/mxuport.c @@ -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 |