]>
Commit | Line | Data |
---|---|---|
745c46a8 GKH |
1 | From db81de767e375743ebb0ad2bcad3326962c2b67e Mon Sep 17 00:00:00 2001 |
2 | From: Johan Hovold <johan@kernel.org> | |
3 | Date: Wed, 18 Feb 2015 11:51:07 +0700 | |
4 | Subject: USB: mxuport: fix null deref when used as a console | |
5 | ||
6 | From: Johan Hovold <johan@kernel.org> | |
7 | ||
8 | commit db81de767e375743ebb0ad2bcad3326962c2b67e upstream. | |
9 | ||
10 | Fix null-pointer dereference at probe when the device is used as a | |
11 | console, in which case the tty argument to open will be NULL. | |
12 | ||
13 | Fixes: ee467a1f2066 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX | |
14 | driver") | |
15 | Signed-off-by: Johan Hovold <johan@kernel.org> | |
16 | Acked-by: Greg Kroah-Hartman <greg@kroah.com> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | ||
19 | --- | |
20 | drivers/usb/serial/mxuport.c | 3 ++- | |
21 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
22 | ||
23 | --- a/drivers/usb/serial/mxuport.c | |
24 | +++ b/drivers/usb/serial/mxuport.c | |
25 | @@ -1284,7 +1284,8 @@ static int mxuport_open(struct tty_struc | |
26 | } | |
27 | ||
28 | /* Initial port termios */ | |
29 | - mxuport_set_termios(tty, port, NULL); | |
30 | + if (tty) | |
31 | + mxuport_set_termios(tty, port, NULL); | |
32 | ||
33 | /* | |
34 | * TODO: use RQ_VENDOR_GET_MSR, once we know what it |