pinctrl: ti: fix error return code of ti_iodelay_probe()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Sat, 6 Mar 2021 12:51:22 +0000 (04:51 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Mar 2021 15:36:45 +0000 (16:36 +0100)
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>
drivers/pinctrl/ti/pinctrl-ti-iodelay.c

index 60a6713..e584826 100644 (file)
@@ -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);