]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.14.36/usb-mxuport-fix-null-deref-when-used-as-a-console.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.14.36 / usb-mxuport-fix-null-deref-when-used-as-a-console.patch
CommitLineData
745c46a8
GKH
1From db81de767e375743ebb0ad2bcad3326962c2b67e Mon Sep 17 00:00:00 2001
2From: Johan Hovold <johan@kernel.org>
3Date: Wed, 18 Feb 2015 11:51:07 +0700
4Subject: USB: mxuport: fix null deref when used as a console
5
6From: Johan Hovold <johan@kernel.org>
7
8commit db81de767e375743ebb0ad2bcad3326962c2b67e upstream.
9
10Fix null-pointer dereference at probe when the device is used as a
11console, in which case the tty argument to open will be NULL.
12
13Fixes: ee467a1f2066 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX
14driver")
15Signed-off-by: Johan Hovold <johan@kernel.org>
16Acked-by: Greg Kroah-Hartman <greg@kroah.com>
17Signed-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