提交 db81de76 编写于 作者: J Johan Hovold

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: ee467a1f ("USB: serial: add Moxa UPORT 12XX/14XX/16XX
driver")
Cc: stable <stable@vger.kernel.org>	# v3.14
Signed-off-by: NJohan Hovold <johan@kernel.org>
Acked-by: NGreg Kroah-Hartman <greg@kroah.com>
上级 d6f7f412
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册