summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2021-03-06 04:51:22 -0800
committerLinus Walleij <linus.walleij@linaro.org>2021-03-15 16:36:45 +0100
commit47386ce36f904583d45c82087d992a50ad612c8b (patch)
treeb9a0a4d08f16bc79f5da670468d0087a3bf738d3
parentbe786ac5a6c4bf4ef3e4c569a045d302c1e60fe6 (diff)
downloadlinux-stable-47386ce36f904583d45c82087d992a50ad612c8b.tar.gz
linux-stable-47386ce36f904583d45c82087d992a50ad612c8b.tar.bz2
linux-stable-47386ce36f904583d45c82087d992a50ad612c8b.zip
pinctrl: ti: fix error return code of ti_iodelay_probe()
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> Link: https://lore.kernel.org/r/20210306125122.15043-1-baijiaju1990@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/ti/pinctrl-ti-iodelay.c3
1 files changed, 2 insertions, 1 deletions
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);