* [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
* Re: [PATCH] serial: st-asc: Potential error pointer dereference
2017-07-17 8:12 [PATCH] serial: st-asc: Potential error pointer dereference Dan Carpenter
@ 2017-07-17 10:28 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2017-07-17 10:28 UTC (permalink / raw)
To: Dan Carpenter
Cc: Patrice Chotard, Greg Kroah-Hartman, Jiri Slaby, linux-serial,
kernel-janitors
On Mon, 17 Jul 2017, Dan Carpenter wrote:
> 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;
> }
Good spot.
Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [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