[3.16.y-ckt stable] Patch "USB: mxuport: fix null deref when used as a console" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Mar 19 10:12:47 UTC 2015


This is a note to let you know that I have just added a patch titled

    USB: mxuport: fix null deref when used as a console

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt9.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 985588fe9380ee3c8e6fff61918b24c7e01b5a71 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan at kernel.org>
Date: Wed, 18 Feb 2015 11:51:07 +0700
Subject: 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 at kernel.org>
Acked-by: Greg Kroah-Hartman <greg at kroah.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/usb/serial/mxuport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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




More information about the kernel-team mailing list