stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* patch "serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference" added to tty-linus
@ 2019-03-19 14:44 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2019-03-19 14:44 UTC (permalink / raw)
  To: pakki001, gregkh, stable


This is a note to let you know that I've just added the patch titled

    serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference

to my tty git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-linus branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


From 32f47179833b63de72427131169809065db6745e Mon Sep 17 00:00:00 2001
From: Aditya Pakki <pakki001@umn.edu>
Date: Mon, 18 Mar 2019 18:50:56 -0500
Subject: serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference

of_match_device on failure to find a matching device can return a NULL
pointer. The patch checks for such a scenrio and passes the error upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/mvebu-uart.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 231f751d1ef4..7e7b1559fa36 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -810,6 +810,9 @@ static int mvebu_uart_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	if (!match)
+		return -ENODEV;
+
 	/* Assume that all UART ports have a DT alias or none has */
 	id = of_alias_get_id(pdev->dev.of_node, "serial");
 	if (!pdev->dev.of_node || id < 0)
-- 
2.21.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-19 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 14:44 patch "serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference" added to tty-linus gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).