Skip to contentSkip to conversation

irqchip/aspeed-scu-ic: Fix an IS_ERR() vs NULL check

PATCH Applied Dan Carpenter 2 participants 2 messages Sep 27, 2025 – Oct 7, 2025

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

PATCH 1/1 irqchip/aspeed-scu-ic: Fix an IS_ERR() vs NULL check

The of_iomap() function doesn't return error pointers, it returns NULL. Fix the error checking to check for NULL pointers.

Fixes 86cd4301c285 ("irqchip/aspeed-scu-ic: Refactor driver to support variant-based initialization")
---
 drivers/irqchip/irq-aspeed-scu-ic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-aspeed-scu-ic.c +2 -2
index 5584e0f82cce..bee59c8c4c93 100644
@@ -215,8 +215,8 @@ static int aspeed_scu_ic_of_init_common(struct aspeed_scu_ic *scu_ic,
 	int irq, rc = 0;
 
 	scu_ic->base = of_iomap(node, 0);
-	if (IS_ERR(scu_ic->base)) {
-		rc = PTR_ERR(scu_ic->base);
+	if (!scu_ic->base) {
+		rc = -ENOMEM;
 		goto err;
 	}
 
Signature · 1 line
2.51.0
merge bot Applied
#1 lore raw
The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     196754c2a04a8ba682b00ea7c818897295c98967
Gitweb:        https://git.kernel.org/tip/196754c2a04a8ba682b00ea7c818897295c98967
Author:        Dan Carpenter <[email protected]>
AuthorDate:    Sat, 27 Sep 2025 15:26:05 +03:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 07 Oct 2025 10:23:22 +02:00

irqchip/aspeed-scu-ic: Fix an IS_ERR() vs NULL check

of_iomap() doesn't return error pointers, it returns NULL. Fix the error checking to check for NULL pointers.

Fixes 86cd4301c285 ("irqchip/aspeed-scu-ic: Refactor driver to support variant-based initialization")
---
 drivers/irqchip/irq-aspeed-scu-ic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-aspeed-scu-ic.c +2 -2
index 5584e0f..bee59c8 100644
@@ -215,8 +215,8 @@ static int aspeed_scu_ic_of_init_common(struct aspeed_scu_ic *scu_ic,
 	int irq, rc = 0;
 
 	scu_ic->base = of_iomap(node, 0);
-	if (IS_ERR(scu_ic->base)) {
-		rc = PTR_ERR(scu_ic->base);
+	if (!scu_ic->base) {
+		rc = -ENOMEM;
 		goto err;
 	}