Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] serial: st-asc: Potential error pointer dereference
@ 2017-07-17  8:12 Dan Carpenter
  2017-07-17 10:28 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-07-17  8:12 UTC (permalink / raw)
  To: Patrice Chotard, Lee Jones
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors

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>

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] =

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-17 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-17  8:12 [PATCH] serial: st-asc: Potential error pointer dereference Dan Carpenter
2017-07-17 10:28 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox