[PATCH 2/2] PCI: j721e: Fix OF node reference leak in j721e_enable_acspcie_refclk()
Siddharth Vadapalli
s-vadapalli at ti.com
Sun Nov 15 22:05:06 PST 2026
On 11/10/26 12:39 PM, zhaofeng2 wrote:
> From: Zhao Feng <zhaofeng2 at cmss.chinamobile.com>
>
> j721e_enable_acspcie_refclk() resolves the "ti,syscon-acspcie-proxy-ctrl"
> phandle with of_parse_phandle_with_fixed_args(), which takes a
> reference on the resolved device node, but the reference is never
> dropped, so the device node is leaked. This is called from
> j721e_pcie_ctrl_init(), which j721e_pcie_resume_noirq() re-invokes
> on every resume, so the leak repeats on every suspend/resume cycle
> as well.
>
> Drop the reference with of_node_put() once the mask argument has been
> consumed.
>
> Fixes: 82c4be4168e2 ("PCI: j721e: Enable ACSPCIE Refclk if "ti,syscon-acspcie-proxy-ctrl" exists")
> Signed-off-by: Zhao Feng <zhaofeng2 at cmss.chinamobile.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli at ti.com>
Regards,
Siddharth.
> ---
> drivers/pci/controller/cadence/pci-j721e.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
> --- a/drivers/pci/controller/cadence/pci-j721e.c
> +++ b/drivers/pci/controller/cadence/pci-j721e.c
> @@ -247,6 +247,7 @@
>
> /* Clear PAD IO disable bits to enable refclk output */
> val = ~(args.args[0]);
> + of_node_put(args.np);
> ret = regmap_update_bits(syscon, 0, mask, val);
> if (ret) {
> dev_err(dev, "failed to enable ACSPCIE refclk: %d\n", ret);
More information about the linux-arm-kernel
mailing list