Skip to contentSkip to conversation

ARM: imx3: Fix CCM node reference leak

PATCH Applied Yuho Choi 2 participants 2 messages May 14 – Jun 1

Subsystems (3)
lore
Share & tools
lore

Yuho Choi

author
#0 lore raw

PATCH 1/1 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 2cf98d12958c ("ARM: imx3: Retrieve the CCM base address from devicetree")
---
 arch/arm/mach-imx/mm-imx3.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/mm-imx3.c +2 -0
index 0788c5cc7f9e..9b0b014d7fe2 100644
@@ -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 */
Signature · 1 line
2.43.0
#1 lore raw

From: Frank Li <[email protected]>

Quoted 8 lines · Yuho Choi

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.

[...]

Applied, thanks!

[1/1] ARM: imx3: Fix CCM node reference leak

      commit: 36d46348eb5fc4bc505cd2290ddd70c25fbe6bb3

Best regards,

Signature · 1 line
Frank Li <[email protected]>