summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-26 08:29:02 -0500
committerBen Hutchings <ben@decadent.org.uk>2019-07-09 22:03:40 +0100
commitb3486c723fe5c2f71ea5ecbafc73203b80edaa82 (patch)
treec70a145ab14f3265f96d28fa568ac00edeae7ab9
parent6cbed80aa2856b5c233352931023838175c9157b (diff)
downloadlinux-stable-b3486c723fe5c2f71ea5ecbafc73203b80edaa82.tar.gz
linux-stable-b3486c723fe5c2f71ea5ecbafc73203b80edaa82.tar.bz2
linux-stable-b3486c723fe5c2f71ea5ecbafc73203b80edaa82.zip
clk: socfpga: fix refcount leak
commit 7f9705beeb3759e69165e7aff588f6488ff6c1ac 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@gmail.com> Fixes: 5343325ff3dd ("clk: socfpga: add a clock driver for the Arria 10 platform") Fixes: a30d27ed739b ("clk: socfpga: fix clock driver for 3.15") Signed-off-by: Stephen Boyd <sboyd@kernel.org> [bwh: Backported to 3.16: drop changes in clk-pll-a10.c] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/clk/socfpga/clk-pll.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/socfpga/clk-pll.c b/drivers/clk/socfpga/clk-pll.c
index de6da957a09d..f091cb1707a3 100644
--- a/drivers/clk/socfpga/clk-pll.c
+++ b/drivers/clk/socfpga/clk-pll.c
@@ -102,6 +102,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;