]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: imx3: Fix CCM node reference leak
authorYuho Choi <dbgh9129@gmail.com>
Thu, 14 May 2026 03:40:04 +0000 (23:40 -0400)
committerFrank Li <Frank.Li@nxp.com>
Mon, 1 Jun 2026 16:17:07 +0000 (12:17 -0400)
of_find_compatible_node() returns a referenced device node. The i.MX31
and i.MX35 early init paths use the node to map the CCM registers with
of_iomap(), but never drop the node reference.

Release the node after the mapping is created.

Fixes: 2cf98d12958c ("ARM: imx3: Retrieve the CCM base address from devicetree")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
arch/arm/mach-imx/mm-imx3.c

index 0788c5cc7f9e6466963e247c72921f81d142b2ec..9b0b014d7fe276ccb502d34a0771a89e99a6bf9e 100644 (file)
@@ -106,6 +106,7 @@ void __init imx31_init_early(void)
        arm_pm_idle = imx31_idle;
        np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
        mx3_ccm_base = of_iomap(np, 0);
+       of_node_put(np);
        BUG_ON(!mx3_ccm_base);
 }
 #endif /* ifdef CONFIG_SOC_IMX31 */
@@ -143,6 +144,7 @@ void __init imx35_init_early(void)
        arch_ioremap_caller = imx3_ioremap_caller;
        np = of_find_compatible_node(NULL, NULL, "fsl,imx35-ccm");
        mx3_ccm_base = of_iomap(np, 0);
+       of_node_put(np);
        BUG_ON(!mx3_ccm_base);
 }
 #endif /* ifdef CONFIG_SOC_IMX35 */