[PATCH] PCI: imx6: Add missing of_node_put() in imx6_pcie_probe

Hongxing Zhu hongxing.zhu at nxp.com
Wed Mar 9 23:41:10 PST 2022


> -----Original Message-----
> From: Miaoqian Lin <linmq006 at gmail.com>
> Sent: 2022Äê3ÔÂ8ÈÕ 10:29
> To: Hongxing Zhu <hongxing.zhu at nxp.com>; Lucas Stach
> <l.stach at pengutronix.de>; Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>; Rob
> Herring <robh at kernel.org>; Krzysztof Wilczy¨½ski <kw at linux.com>; Bjorn
> Helgaas <bhelgaas at google.com>; Shawn Guo <shawnguo at kernel.org>;
> Sascha Hauer <s.hauer at pengutronix.de>; Pengutronix Kernel Team
> <kernel at pengutronix.de>; Fabio Estevam <festevam at gmail.com>;
> dl-linux-imx <linux-imx at nxp.com>; Trent Piepho <tpiepho at impinj.com>;
> linux-pci at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> linux-kernel at vger.kernel.org
> Cc: linmq006 at gmail.com
> Subject: [PATCH] PCI: imx6: Add missing of_node_put() in imx6_pcie_probe
> 
> The device_node pointer is returned by of_parse_phandle()  with refcount
> incremented. We should use of_node_put() on it when done.
> 
> Fixes: 1df82ec46600 ("PCI: imx: Add workaround for e10728, IMX7d PCIe PLL
> failure")
> Signed-off-by: Miaoqian Lin <linmq006 at gmail.com>

Reviewed-by: Richard Zhu <hongxing.zhu at nxp.com>
Thanks.

Best Regards
Richard Zhu

> ---
>  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 6974bd5aa116..bcc338ab6c11 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -1050,6 +1050,7 @@ static int imx6_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.17.1



More information about the linux-arm-kernel mailing list