* [PATCH] pinctrl: ti: fix error return code of ti_iodelay_probe()
@ 2021-03-06 12:51 Jia-Ju Bai
2021-03-15 15:34 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-06 12:51 UTC (permalink / raw)
To: linus.walleij, jrdr.linux, zhengyongjun3, grandmaster
Cc: linux-gpio, linux-kernel, Jia-Ju Bai
When ti_iodelay_pinconf_init_dev() fails, no error return code of
ti_iodelay_probe() is assigned.
To fix this bug, ret is assigned with the return value of
ti_iodelay_pinconf_init_dev(), and then ret is checked.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 60a67139ff0a..e5848269175a 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -867,7 +867,8 @@ static int ti_iodelay_probe(struct platform_device *pdev)
goto exit_out;
}
- if (ti_iodelay_pinconf_init_dev(iod))
+ ret = ti_iodelay_pinconf_init_dev(iod);
+ if (ret)
goto exit_out;
ret = ti_iodelay_alloc_pins(dev, iod, res->start);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: ti: fix error return code of ti_iodelay_probe()
2021-03-06 12:51 [PATCH] pinctrl: ti: fix error return code of ti_iodelay_probe() Jia-Ju Bai
@ 2021-03-15 15:34 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2021-03-15 15:34 UTC (permalink / raw)
To: Jia-Ju Bai
Cc: Souptick Joarder, Zheng Yongjun, Alexander A. Klimov,
open list:GPIO SUBSYSTEM, linux-kernel
On Sat, Mar 6, 2021 at 1:51 PM Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
> When ti_iodelay_pinconf_init_dev() fails, no error return code of
> ti_iodelay_probe() is assigned.
> To fix this bug, ret is assigned with the return value of
> ti_iodelay_pinconf_init_dev(), and then ret is checked.
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-15 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06 12:51 [PATCH] pinctrl: ti: fix error return code of ti_iodelay_probe() Jia-Ju Bai
2021-03-15 15:34 ` Linus Walleij
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).