Skip to contentSkip to conversation

ARM: imx35: Fix refcount leak in mx35_read_cpu_rev

PATCH New Miaoqian Lin 1 participant 1 message Apr 21, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx35: Fix refcount leak in mx35_read_cpu_rev

The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount.

Fixes f68ea682d1da ("ARM: imx35: Retrieve the IIM base address from devicetree")
---
 arch/arm/mach-imx/cpu-imx35.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-imx/cpu-imx35.c +1 -0
index 80e7d8ab9f1b..3ae4a3dc44fb 100644
@@ -22,6 +22,7 @@ static int mx35_read_cpu_rev(void)
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim");
 	iim_base = of_iomap(np, 0);
 	BUG_ON(!iim_base);
+	of_node_put(np);
 
 	rev = imx_readl(iim_base + MXC_IIMSREV);
 	switch (rev) {
Signature · 1 line
2.17.1