aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2015-02-17 23:51:07 -0500
committerJohan Hovold <johan@kernel.org>2015-02-26 11:13:59 -0500
commitdb81de767e375743ebb0ad2bcad3326962c2b67e (patch)
treee4f1ed8f9696f35e408093f6be8e64c39c1a6bbb /drivers/usb
parentd6f7f41274b548435ab5de1041a492fc4a714196 (diff)
USB: mxuport: fix null deref when used as a console
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") Cc: stable <stable@vger.kernel.org> # v3.14 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/mxuport.c3
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)
1284 } 1284 }
1285 1285
1286 /* Initial port termios */ 1286 /* Initial port termios */
1287 mxuport_set_termios(tty, port, NULL); 1287 if (tty)
1288 mxuport_set_termios(tty, port, NULL);
1288 1289
1289 /* 1290 /*
1290 * TODO: use RQ_VENDOR_GET_MSR, once we know what it 1291 * TODO: use RQ_VENDOR_GET_MSR, once we know what it