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

Jiri Slaby jirislaby at kernel.org
Fri Sep 5 01:28:55 PDT 2025


On 03. 09. 25, 15:51, Miaoqian Lin wrote:
> 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.

How did you verify the node can go after of_address_to_resource()?

> Fixes: 1df82ec46600 ("PCI: imx: Add workaround for e10728, IMX7d PCIe PLL failure")
> Cc: stable at vger.kernel.org
> Signed-off-by: Miaoqian Lin <linmq006 at gmail.com>
> ---
>   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);

So why not to use __free(device_node)?

thanks,
-- 
js
suse labs




More information about the linux-arm-kernel mailing list