[tip: irq/drivers] irqchip/aslint-sswi: Fix error check of of_io_request_and_map() result

tip-bot2 for Vladimir Kondratiev posted 1 patch 2 weeks, 5 days ago
drivers/irqchip/irq-aclint-sswi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[tip: irq/drivers] irqchip/aslint-sswi: Fix error check of of_io_request_and_map() result
Posted by tip-bot2 for Vladimir Kondratiev 2 weeks, 5 days ago
The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     a384f2ed886d4417d50fdad78aaf1ccf870d62e6
Gitweb:        https://git.kernel.org/tip/a384f2ed886d4417d50fdad78aaf1ccf870d62e6
Author:        Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
AuthorDate:    Sun, 18 Jan 2026 10:28:43 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sun, 18 Jan 2026 14:39:18 +01:00

irqchip/aslint-sswi: Fix error check of of_io_request_and_map() result

of_io_request_and_map() returns IOMEM_ERR_PTR() on failure which is
non-NULL.

Fixes: 8a7f030df897 ("irqchip/aslint-sswi: Request IO memory resource")
Reported-by: Chris Mason <clm@meta.com>
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260118082843.2786630-1-vladimir.kondratiev@mobileye.com
Closes: https://lore.kernel.org/all/20260116124257.78357-1-clm@meta.com
---
 drivers/irqchip/irq-aclint-sswi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
index 325501f..ca06efd 100644
--- a/drivers/irqchip/irq-aclint-sswi.c
+++ b/drivers/irqchip/irq-aclint-sswi.c
@@ -110,8 +110,10 @@ static int __init aclint_sswi_probe(struct fwnode_handle *fwnode)
 		return -EINVAL;
 
 	reg = of_io_request_and_map(to_of_node(fwnode), 0, NULL);
-	if (!reg)
-		return -ENOMEM;
+	if (IS_ERR(reg)) {
+		pr_err("%pfwP: Failed to map MMIO region\n", fwnode);
+		return PTR_ERR(reg);
+	}
 
 	/* Parse SSWI setting */
 	rc = aclint_sswi_parse_irq(fwnode, reg);