irqchip/aspeed-scu-ic: Fix an IS_ERR() vs NULL check
Subsystems (4)
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")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/irqchip/irq-aspeed-scu-ic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-aspeed-scu-ic.c +2 -2
@@ -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
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")
Signed-off-by Dan Carpenter <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
--- drivers/irqchip/irq-aspeed-scu-ic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-aspeed-scu-ic.c +2 -2
@@ -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; }