[PATCH v2] PCI: mobiveil: Drop unnecessary msi-parent check in ls_g4_pcie_probe()

Vishal Satle vishalsatleit24 at gmail.com
Wed Nov 18 01:37:31 PST 2026


ls_g4_pcie_probe() calls of_parse_phandle(np, "msi-parent", 0) solely as
a boolean existence check without releasing the returned device_node via
of_node_put(), leaking a reference count on probe.

Instead of keeping the check with of_node_put(), drop the check
altogether. The driver does not use the phandle directly (the irqchip
layer handles it), other PCI controller drivers do not enforce this
check, and without "msi-parent" INTx still works even though MSIs will
not, so probing does not need to fail.

Also remove the now-unused local variable np.

Suggested-by: Manivannan Sadhasivam <mani at kernel.org>
Cc: stable at vger.kernel.org
Signed-off-by: Vishal Satle <vishalsatleit24 at gmail.com>
---
Changes in v2:
- Drop the msi-parent check and the now-unused np variable altogether
  instead of adding of_node_put(), as suggested by Manivannan.
- Link to v1: https://lore.kernel.org/all/20261027094427.143733-1-vishalsatleit24@gmail.com/

 drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
index 4919b27ea..f31be6327 100644
--- a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
+++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
@@ -198,14 +198,8 @@ static int __init ls_g4_pcie_probe(struct platform_device *pdev)
 	struct pci_host_bridge *bridge;
 	struct mobiveil_pcie *mv_pci;
 	struct ls_g4_pcie *pcie;
-	struct device_node *np = dev->of_node;
 	int ret;
 
-	if (!of_parse_phandle(np, "msi-parent", 0)) {
-		dev_err(dev, "Failed to find msi-parent\n");
-		return -EINVAL;
-	}
-
 	bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
 	if (!bridge)
 		return -ENOMEM;
-- 
2.53.0




More information about the linux-arm-kernel mailing list