2023-10-07 07:57:18

by Ma Ke

[permalink] [raw]
Subject: [PATCH] irqchip/gic-v2m: Fix refcount leak in gicv2m_of_init

Add the missing of_node_put() to release the refcount incremented
by of_find_matching_node().

Signed-off-by: Ma Ke <[email protected]>
---
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