clk: socfpga: fix refcount leak
Subsystems (2)
PATCH 1/1 clk: socfpga: fix refcount leak
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 <[email protected]>
--- drivers/clk/socfpga/clk-pll-a10.c | 1 + drivers/clk/socfpga/clk-pll.c | 1 + 2 files changed, 2 insertions(+)
drivers/clk/socfpga/clk-pll-a10.c +1 -0
@@ -95,6 +95,7 @@ static struct clk * __init __socfpga_pll_init(struct device_node *node, clkmgr_np =of_find_compatible_node (NULL ,NULL ,"altr,clk-mgr" ); clk_mgr_a10_base_addr =of_iomap (clkmgr_np,0 ); +of_node_put (clkmgr_np);BUG_ON (!clk_mgr_a10_base_addr); pll_clk->hw.reg = clk_mgr_a10_base_addr + reg;
drivers/clk/socfpga/clk-pll.c +1 -0
@@ -100,6 +100,7 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node, clkmgr_np =of_find_compatible_node (NULL ,NULL ,"altr,clk-mgr" ); clk_mgr_base_addr =of_iomap (clkmgr_np,0 ); +of_node_put (clkmgr_np);BUG_ON (!clk_mgr_base_addr); pll_clk->hw.reg = clk_mgr_base_addr + reg;
Signature · 1 line
2.17.0
Quoting Yangtao Li (2018-12-26 05:29:02)
Quoted 6 lines
The
of_find_compatible_node()returns a node pointer with refcount incremented, but there is the lack of use of theof_node_put()when done. Add the missingof_node_put()to release the refcount.Signed-off-by Yangtao Li <[email protected]>---
Applied to clk-next