Skip to contentSkip to conversation

soc: ixp4xx: qmgr: Fix an NULL vs IS_ERR() check in probe

PATCH In review Dan Carpenter 2 participants 2 messages May 3, 2019 – May 4, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: ixp4xx: qmgr: Fix an NULL vs IS_ERR() check in probe

The devm_ioremap_resource() function doesn't retunr NULL, it returns error pointers.

Fixes ecc133c6da60 ("soc: ixp4xx: qmgr: Pass resources")
---
 drivers/soc/ixp4xx/ixp4xx-qmgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/ixp4xx/ixp4xx-qmgr.c +2 -2
index 13a8a13c9b01..bb90670ec160 100644
@@ -385,8 +385,8 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
 	if (!res)
 		return -ENODEV;
 	qmgr_regs = devm_ioremap_resource(dev, res);
-	if (!qmgr_regs)
-		return -ENOMEM;
+	if (IS_ERR(qmgr_regs))
+		return PTR_ERR(qmgr_regs);
 
 	irq1 = platform_get_irq(pdev, 0);
 	if (irq1 <= 0)
Signature · 1 line
2.18.0
#1 lore raw
Quoted 5 lines · Dan Carpenter

The devm_ioremap_resource() function doesn't retunr NULL, it returns error pointers.

Fixes ecc133c6da60 ("soc: ixp4xx: qmgr: Pass resources")

Good catch! Patch applied.

I will make sure this fix lands in ARM SoC for v5.2.

Yours,
Linus Walleij