linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: mediatek-gen3: Fix refcount leak in mtk_pcie_init_irq_domains
@ 2022-05-26 11:02 Miaoqian Lin
  2022-05-26 18:44 ` Rob Herring
  2022-05-27  8:45 ` Miles Chen
  0 siblings, 2 replies; 8+ messages in thread
From: Miaoqian Lin @ 2022-05-26 11:02 UTC (permalink / raw)
  To: Ryder Lee, Jianjun Wang, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyński, Bjorn Helgaas, Matthias Brugger,
	Marc Zyngier, linux-pci, linux-mediatek, linux-kernel,
	linux-arm-kernel
  Cc: linmq006

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

Fixes: 814cceebba9b ("PCI: mediatek-gen3: Add INTx support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/pci/controller/pcie-mediatek-gen3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index 3e8d70bfabc6..da8e9db0abdf 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -600,6 +600,7 @@ static int mtk_pcie_init_irq_domains(struct mtk_gen3_pcie *pcie)
 						  &intx_domain_ops, pcie);
 	if (!pcie->intx_domain) {
 		dev_err(dev, "failed to create INTx IRQ domain\n");
+		of_node_put(intc_node);
 		return -ENODEV;
 	}
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-31 14:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 11:02 [PATCH] PCI: mediatek-gen3: Fix refcount leak in mtk_pcie_init_irq_domains Miaoqian Lin
2022-05-26 18:44 ` Rob Herring
2022-05-27  8:45 ` Miles Chen
2022-05-28  9:19   ` Miaoqian Lin
2022-05-30  2:19     ` Miles Chen
2022-05-30  6:54       ` Miaoqian Lin
2022-05-30  7:35         ` Miles Chen
2022-05-31 14:01           ` Miaoqian Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).