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: Clément Léger <clement.leger@bootlin.com>
Link: https://lore.kernel.org/r/20230117144929.423089-1-clement.leger@bootlin.com
Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Clément Léger 2023-01-17 15:49:29 +01:00 committed by Rob Herring
parent 7e38085d9c
commit eb2b4ecf72

View File

@ -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);