[PATCH] irqchip: Fix refcount leak bug in irq-ls-extirq.c

From: Liang He
Date: Sat Jun 18 2022 - 03:31:35 EST


In ls_extirq_parse_map(), we need to keep refcount balance in the
'while' loop. For each of_find_node_by_phandle(), we need a paired
of_node_put().

Signed-off-by: Liang He <windhl@xxxxxxx>
---
drivers/irqchip/irq-ls-extirq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index 853b3972dbe7..82fffa37ee86 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -126,6 +126,7 @@ ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
return -EINVAL;
priv->map[hwirq].fwnode = &ipar->fwnode;
ret = of_property_read_u32(ipar, "#interrupt-cells", &intsize);
+ of_node_put(ipar);
if (ret)
return ret;

--
2.25.1