[PATCH] irqchip: Add missing of_ndoe_get() in its_of_probe()

From: Liang He
Date: Wed Jun 22 2022 - 02:22:17 EST


We need to add missing of_node_get() for of_find_matching_node() to
keep refcount balance.

Note: of_find_matching_node() will decrease the refcount of its first
arg.

Signed-off-by: Liang He <windhl@xxxxxxx>
---
drivers/irqchip/irq-gic-v3-its.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 5ff09de6c48f..829893cc5e10 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -5309,6 +5309,7 @@ static int __init its_of_probe(struct device_node *node)
* reset, don't even try to go any further, as this could
* result in something even worse.
*/
+ of_node_get(node);
for (np = of_find_matching_node(node, its_device_id); np;
np = of_find_matching_node(np, its_device_id)) {
int err;
@@ -5323,6 +5324,7 @@ static int __init its_of_probe(struct device_node *node)
return err;
}

+ of_node_get(node);
for (np = of_find_matching_node(node, its_device_id); np;
np = of_find_matching_node(np, its_device_id)) {
if (!of_device_is_available(np))
--
2.25.1