bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 25 May 2020 09:16:34 +0000 (11:16 +0200)
committerArnd Bergmann <arnd@arndb.de>
Mon, 25 May 2020 22:02:42 +0000 (00:02 +0200)
In case of error, the function of_find_matching_node() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Link: https://lore.kernel.org/r/20200525091634.8274-1-linus.walleij@linaro.org
Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200520032150.165388-1-weiyongjun1@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/bus/arm-integrator-lm.c

index 669ea7e1f92e9052ba679387cc8f5a1205ee1c9c..845b6c43fef897bc1cf562d6f2251c01fb8c9861 100644 (file)
@@ -78,10 +78,10 @@ static int integrator_ap_lm_probe(struct platform_device *pdev)
 
        /* Look up the system controller */
        syscon = of_find_matching_node(NULL, integrator_ap_syscon_match);
-       if (IS_ERR(syscon)) {
+       if (!syscon) {
                dev_err(dev,
                        "could not find Integrator/AP system controller\n");
-               return PTR_ERR(syscon);
+               return -ENODEV;
        }
        map = syscon_node_to_regmap(syscon);
        if (IS_ERR(map)) {