ARM: imx35: Fix refcount leak in mx35_read_cpu_rev
Subsystems (3)
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")
Signed-off-by Miaoqian Lin <[email protected]>
--- arch/arm/mach-imx/cpu-imx35.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-imx/cpu-imx35.c +1 -0
@@ -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