[PATCH 3.16 008/129] clk: imx6sx: fix refcount leak in imx6sx_clocks_init()

From: Ben Hutchings
Date: Sun Jul 07 2019 - 15:41:54 EST


3.16.70-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Yangtao Li <tiny.windzz@xxxxxxxxx>

commit 1731e14fb30212dd8c1e9f8fc1af061e56498c55 upstream.

The of_find_compatible_node() returns a node pointer with refcount
incremented, but there is the lack of use of the of_node_put() when
done. Add the missing of_node_put() to release the refcount.

Signed-off-by: Yangtao Li <tiny.windzz@xxxxxxxxx>
Fixes: d55135689019 ("ARM: imx: add clock driver for imx6sx")
Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
arch/arm/mach-imx/clk-imx6sx.c | 1 +
1 file changed, 1 insertion(+)

--- a/arch/arm/mach-imx/clk-imx6sx.c
+++ b/arch/arm/mach-imx/clk-imx6sx.c
@@ -143,6 +143,7 @@ static void __init imx6sx_clocks_init(st
np = of_find_compatible_node(NULL, NULL, "fsl,imx6sx-anatop");
base = of_iomap(np, 0);
WARN_ON(!base);
+ of_node_put(np);

/* type name parent_name base div_mask */
clks[IMX6SX_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f);