Skip to contentSkip to conversation

irqchip/ti-sci: Fix refcount leak in ti_sci_intr_irq_domain_probe

PATCH Applied Miaoqian Lin 2 participants 2 messages Jan 2, 2023 – Feb 5, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/ti-sci: Fix refcount leak in ti_sci_intr_irq_domain_probe

of_irq_find_parent() returns a node pointer with refcount incremented, We should use of_node_put() on it when not needed anymore. Add missing of_node_put() to avoid refcount leak.

Fixes cd844b0715ce ("irqchip/ti-sci-intr: Add support for Interrupt Router driver")
---
 drivers/irqchip/irq-ti-sci-intr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-ti-sci-intr.c +1 -0
index fe8fad22bcf9..020ddf29efb8 100644
@@ -236,6 +236,7 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
 	}
 
 	parent_domain = irq_find_host(parent_node);
+	of_node_put(parent_node);
 	if (!parent_domain) {
 		dev_err(dev, "Failed to find IRQ parent domain\n");
 		return -ENODEV;
Signature · 1 line
2.25.1
#1 lore raw
The following commit has been merged into the irq/irqchip-next branch of irqchip:

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     02298b7bae12936ca313975b02e7f98b06670d37
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/02298b7bae12936ca313975b02e7f98b06670d37
Author:        Miaoqian Lin <[email protected]>
AuthorDate:    Mon, 02 Jan 2023 12:56:10 +04:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Sun, 05 Feb 2023 11:11:24 

irqchip/ti-sci: Fix refcount leak in ti_sci_intr_irq_domain_probe

of_irq_find_parent() returns a node pointer with refcount incremented, We should use of_node_put() on it when not needed anymore. Add missing of_node_put() to avoid refcount leak.

Fixes cd844b0715ce ("irqchip/ti-sci-intr: Add support for Interrupt Router driver")
---
 drivers/irqchip/irq-ti-sci-intr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-ti-sci-intr.c +1 -0
index fe8fad2..020ddf2 100644
@@ -236,6 +236,7 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
 	}
 
 	parent_domain = irq_find_host(parent_node);
+	of_node_put(parent_node);
 	if (!parent_domain) {
 		dev_err(dev, "Failed to find IRQ parent domain\n");
 		return -ENODEV;