Thread (4 messages) flat view 4 messages, 4 authors, 2025-09-05
STALE337d

[PATCH] PCI: imx: fix device node reference leak in imx_pcie_probe

From: Miaoqian Lin <hidden>
Date: 2025-09-03 13:52:00
Also in: imx, linux-pci, lkml, stable
Subsystem: pci driver for imx6, pci native host bridge and endpoint drivers, pci subsystem, the rest · Maintainers: Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Krzysztof Wilczyński, Manivannan Sadhasivam, Bjorn Helgaas, Linus Torvalds

As the doc of of_parse_phandle() states:
"The device_node pointer with refcount incremented.  Use
 * of_node_put() on it when done."
Add missing of_node_put() after of_parse_phandle() call to properly
release the device node reference.

Found via static analysis.

Fixes: 1df82ec46600 ("PCI: imx: Add workaround for e10728, IMX7d PCIe PLL failure")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <redacted>
---
 drivers/pci/controller/dwc/pci-imx6.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 80e48746bbaf..618bc4b08a8b 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1636,6 +1636,7 @@ static int imx_pcie_probe(struct platform_device *pdev)
 		struct resource res;
 
 		ret = of_address_to_resource(np, 0, &res);
+		of_node_put(np);
 		if (ret) {
 			dev_err(dev, "Unable to map PCIe PHY\n");
 			return ret;
-- 
2.35.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help