diff mbox series

bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe()

Message ID 20200525091634.8274-1-linus.walleij@linaro.org (mailing list archive)
State Mainlined
Commit 97a2f40e3801905c7221df8ce2f2231632ce8ce4
Headers show
Series bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe() | expand

Commit Message

Linus Walleij May 25, 2020, 9:16 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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.

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>
---
Hi SoC guys, please apply this patch directly for v5.8
wherever the other Versatile stuff was applied, thanks!
---
 drivers/bus/arm-integrator-lm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

patchwork-bot+linux-soc@kernel.org May 25, 2020, 10:42 p.m. UTC | #1
Hello:

This patch was applied to soc/soc.git (refs/heads/for-next).

On Mon, 25 May 2020 11:16:34 +0200 you wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> 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.
> 
> 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>
> 
> [...]


Here is a summary with links:
  - bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe()
    https://git.kernel.org/soc/soc/c/97a2f40e3801905c7221df8ce2f2231632ce8ce4

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
index 669ea7e1f92e..845b6c43fef8 100644
--- a/drivers/bus/arm-integrator-lm.c
+++ b/drivers/bus/arm-integrator-lm.c
@@ -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)) {