[PATCH 03/16] irqchip/sifive-plic: do not iounmap devm mappings
From: Haofeng Li
Date: Tue Jul 14 2026 - 09:25:15 EST
From: Haofeng Li <lihaofeng@xxxxxxxxxx>
plic_probe() maps registers with of_iomap() on the OF path, but with
devm_platform_ioremap_resource() on the ACPI/platform path.
fail_free_regs always calls iounmap(regs), which double-unmaps managed
mappings on the non-OF path.
Only call iounmap(regs) when the fwnode is an OF node.
Fixes: 206dd13a1011 ("irqchip/sifive-plic: Add ACPI support")
Signed-off-by: Haofeng Li <lihaofeng@xxxxxxxxxx>
---
drivers/irqchip/irq-sifive-plic.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 5b0dac104814..0bddad388741 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -819,7 +819,9 @@ static int plic_probe(struct fwnode_handle *fwnode)
fail_free_priv:
kfree(priv);
fail_free_regs:
- iounmap(regs);
+ /* Only OF path uses of_iomap(); ACPI/platform uses devm mapping. */
+ if (is_of_node(fwnode))
+ iounmap(regs);
return error;
}
--
2.25.1