diff options
author | Clément Léger <clement.leger@bootlin.com> | 2023-01-17 15:49:29 +0100 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2023-01-18 18:31:42 +0100 |
commit | eb2b4ecf7299ee39ee9cecc4d3f2633aeb10cefb (patch) | |
tree | b6279aa7919836f1db615ed5bf328dbf66dc6248 /drivers/of | |
parent | dt-bindings: riscv: add SBI PMU event mappings (diff) | |
download | linux-eb2b4ecf7299ee39ee9cecc4d3f2633aeb10cefb.tar.xz linux-eb2b4ecf7299ee39ee9cecc4d3f2633aeb10cefb.zip |
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>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/irq.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index e9bf5236ed89..174900072c18 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -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); |