Commit eb2b4ecf authored by Clément Léger's avatar Clément Léger Committed by Rob Herring
Browse files

of/irq: add missing of_node_put() for interrupt parent node



After calling of_irq_parse_one(), the node provided in the of_phandle_args
has a refcount increment by one. Add missing of_node_put in of_irq_get()
to decrement the refcount once used.

Signed-off-by: default avatarClément Léger <clement.leger@bootlin.com>
Link: https://lore.kernel.org/r/20230117144929.423089-1-clement.leger@bootlin.com


Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 7e38085d
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -438,10 +438,16 @@ int of_irq_get(struct device_node *dev, int index)
		return rc;

	domain = irq_find_host(oirq.np);
	if (!domain)
		return -EPROBE_DEFER;
	if (!domain) {
		rc = -EPROBE_DEFER;
		goto out;
	}

	return irq_create_of_mapping(&oirq);
	rc = irq_create_of_mapping(&oirq);
out:
	of_node_put(oirq.np);

	return rc;
}
EXPORT_SYMBOL_GPL(of_irq_get);