Skip to contentSkip to conversation

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

PATCH New Liang He 1 participant 1 message Jun 18, 2022 irqchip drivers

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 irqchip: Fix refcount leak bug in irq-ls-extirq.c

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().

---
 drivers/irqchip/irq-ls-extirq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-ls-extirq.c +1 -0
index 853b3972dbe7..82fffa37ee86 100644
@@ -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;
 
Signature · 1 line
2.25.1