Skip to contentSkip to conversation

irqchip/irq-mvebu-gicp: Fix refcount leak in mvebu_gicp_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/irq-mvebu-gicp: Fix refcount leak in mvebu_gicp_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 a68a63cb4dfc ("irqchip/irq-mvebu-gicp: Add new driver for Marvell GICP")
---
 drivers/irqchip/irq-mvebu-gicp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-mvebu-gicp.c +1 -0
index fe88a782173d..c43a345061d5 100644
@@ -221,6 +221,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
 	}
 
 	parent_domain = irq_find_host(irq_parent_dn);
+	of_node_put(irq_parent_dn);
 	if (!parent_domain) {
 		dev_err(&pdev->dev, "failed to find parent IRQ 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:     9419e700021a393f67be36abd0c4f3acc6139041
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/9419e700021a393f67be36abd0c4f3acc6139041
Author:        Miaoqian Lin <[email protected]>
AuthorDate:    Mon, 02 Jan 2023 12:42:08 +04:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Sun, 05 Feb 2023 11:11:24 

irqchip/irq-mvebu-gicp: Fix refcount leak in mvebu_gicp_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 a68a63cb4dfc ("irqchip/irq-mvebu-gicp: Add new driver for Marvell GICP")
---
 drivers/irqchip/irq-mvebu-gicp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-mvebu-gicp.c +1 -0
index fe88a78..c43a345 100644
@@ -221,6 +221,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
 	}
 
 	parent_domain = irq_find_host(irq_parent_dn);
+	of_node_put(irq_parent_dn);
 	if (!parent_domain) {
 		dev_err(&pdev->dev, "failed to find parent IRQ domain\n");
 		return -ENODEV;