Skip to contentSkip to conversation

irqchip/alpine-msi: Fix refcount leak in alpine_msix_init_domains

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/alpine-msi: Fix refcount leak in alpine_msix_init_domains

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 e6b78f2c3e14 ("irqchip: Add the Alpine MSIX interrupt controller")
---
 drivers/irqchip/irq-alpine-msi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-alpine-msi.c +1 -0
index 5ddb8e578ac6..fc1ef7de3797 100644
@@ -199,6 +199,7 @@ static int alpine_msix_init_domains(struct alpine_msix_data *priv,
 	}
 
 	gic_domain = irq_find_host(gic_node);
+	of_node_put(gic_node);
 	if (!gic_domain) {
 		pr_err("Failed to find the GIC domain\n");
 		return -ENXIO;
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:     071d068b89e95d1b078aa6bbcb9d0961b77d6aa1
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/071d068b89e95d1b078aa6bbcb9d0961b77d6aa1
Author:        Miaoqian Lin <[email protected]>
AuthorDate:    Mon, 02 Jan 2023 12:28:10 +04:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Sun, 05 Feb 2023 11:11:24 

irqchip/alpine-msi: Fix refcount leak in alpine_msix_init_domains

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 e6b78f2c3e14 ("irqchip: Add the Alpine MSIX interrupt controller")
---
 drivers/irqchip/irq-alpine-msi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/irqchip/irq-alpine-msi.c +1 -0
index 5ddb8e5..fc1ef7d 100644
@@ -199,6 +199,7 @@ static int alpine_msix_init_domains(struct alpine_msix_data *priv,
 	}
 
 	gic_domain = irq_find_host(gic_node);
+	of_node_put(gic_node);
 	if (!gic_domain) {
 		pr_err("Failed to find the GIC domain\n");
 		return -ENXIO;