Blob Blame History Raw
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 17 Jul 2017 11:12:38 +0300
Subject: [PATCH] serial: st-asc: Potential error pointer dereference
References: bnc#1060662
Patch-mainline: v4.12.4
Git-commit: 2b01bfaeb41e1563322448d9b392ac924cbf22ef

commit 2b01bfaeb41e1563322448d9b392ac924cbf22ef upstream.

It looks like we intended to return an error code here, because we
dereference "ascport->pinctrl" on the next lines.

Fixes: 6929cb00a501 ("serial: st-asc: Read in all Pinctrl states")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/st-asc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index f5335be344f6..6b0ca65027d0 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -758,6 +758,7 @@ static int asc_init_port(struct asc_port *ascport,
 	if (IS_ERR(ascport->pinctrl)) {
 		ret = PTR_ERR(ascport->pinctrl);
 		dev_err(&pdev->dev, "Failed to get Pinctrl: %d\n", ret);
+		return ret;
 	}
 
 	ascport->states[DEFAULT] =
-- 
2.14.2