[PATCH] irqchip/gic-v2m: Fix refcount leak in gicv2m_of_init
From: Ma Ke
Date: Sat Oct 07 2023 - 03:55:16 EST
Add the missing of_node_put() to release the refcount incremented
by of_find_matching_node().
Signed-off-by: Ma Ke <make_ruc2021@xxxxxxx>
---
drivers/irqchip/irq-gic-v2m.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index f2ff4387870d..d3e54c557b4c 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -427,6 +427,7 @@ static int __init gicv2m_of_init(struct fwnode_handle *parent_handle,
ret = of_address_to_resource(child, 0, &res);
if (ret) {
pr_err("Failed to allocate v2m resource.\n");
+ of_node_put(child);
break;
}
--
2.37.2