[PATCH 1/3] irqchip/gic-v3: add of_node_put() when finish using the device node
Yang Yingliang
yangyingliang at huawei.com
Sun May 8 23:32:04 PDT 2022
of_find_node_by_phandle() returns a node pointer with refcount
incremented, use of_node_put() on it when done.
Fixes: e3825ba1af3a ("irqchip/gic-v3: Add support for partitioned PPIs")
Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang at huawei.com>
---
drivers/irqchip/irq-gic-v3.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index b252d5534547..fda39adc7cd6 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1597,6 +1597,7 @@ static int partition_domain_translate(struct irq_domain *d,
ppi_idx = __gic_get_ppi_index(ppi_intid);
ret = partition_translate_id(gic_data.ppi_descs[ppi_idx],
of_node_to_fwnode(np));
+ of_node_put(np);
if (ret < 0)
return ret;
@@ -1906,12 +1907,15 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
continue;
cpu = of_cpu_node_to_id(cpu_node);
- if (WARN_ON(cpu < 0))
+ if (WARN_ON(cpu < 0)) {
+ of_node_put(cpu_node);
continue;
+ }
pr_cont("%pOF[%d] ", cpu_node, cpu);
cpumask_set_cpu(cpu, &part->mask);
+ of_node_put(cpu_node);
}
pr_cont("}\n");
--
2.25.1
More information about the linux-arm-kernel
mailing list