Re: [PATCH] PCI: xgene: Fix device node reference leak in xgene_pcie_probe()
From: Manivannan Sadhasivam
Date: Thu Sep 10 2026 - 08:24:44 EST
On Fri, Aug 14, 2026 at 09:41:18PM +0800, Ruoyu Wang wrote:
> xgene_pcie_probe() takes an extra reference to the platform device's OF
> node and stores it in port->node. The driver never drops the reference,
> so every probe attempt that reaches this point leaks it, including when
> CSR mapping or a later initialization step fails.
>
> The platform device already holds the node reference, and port->node is
> only dereferenced synchronously by xgene_pcie_setup() before probe
> returns. Store the borrowed pointer instead of taking another reference.
>
> This issue was found by a static analysis checker and confirmed by
> manual source review.
>
> Fixes: 5f6b6ccdbe1c ("PCI: xgene: Add APM X-Gene PCIe driver")
> Signed-off-by: Ruoyu Wang <ruoyuw560@xxxxxxxxx>
This was fixed by commit, 4869db344e76 ("PCI: xgene: Drop unnecessary OF node
reference").
- Mani
--
மணிவண்ணன் சதாசிவம்