Skip to content

Commit 36d4634

Browse files
Uuuuuuhonxpfrankli
authored andcommitted
ARM: imx3: Fix CCM node reference leak
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: 2cf98d1 ("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>
1 parent 2430f20 commit 36d4634

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/arm/mach-imx/mm-imx3.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void __init imx31_init_early(void)
106106
arm_pm_idle = imx31_idle;
107107
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
108108
mx3_ccm_base = of_iomap(np, 0);
109+
of_node_put(np);
109110
BUG_ON(!mx3_ccm_base);
110111
}
111112
#endif /* ifdef CONFIG_SOC_IMX31 */
@@ -143,6 +144,7 @@ void __init imx35_init_early(void)
143144
arch_ioremap_caller = imx3_ioremap_caller;
144145
np = of_find_compatible_node(NULL, NULL, "fsl,imx35-ccm");
145146
mx3_ccm_base = of_iomap(np, 0);
147+
of_node_put(np);
146148
BUG_ON(!mx3_ccm_base);
147149
}
148150
#endif /* ifdef CONFIG_SOC_IMX35 */

0 commit comments

Comments
 (0)