summaryrefslogtreecommitdiff
path: root/drivers/clk/st
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-08-04 19:31:51 +0300
committerStephen Boyd <sboyd@kernel.org>2019-08-08 01:26:32 +0300
commitd432d04560301c6350158dc4a7e8275b331fd480 (patch)
tree744cdff49922927abf22dea961f9704f7e76f5da /drivers/clk/st
parentd55841ce1115ce08614bde66a780211f4ea12ae1 (diff)
downloadlinux-d432d04560301c6350158dc4a7e8275b331fd480.tar.xz
clk: st: clk-flexgen: Add of_node_put() in st_of_flexgen_setup()
In function st_of_flexgen_setup, variable pnode takes the return value of of_get_parent, which gets a node but does not put it. If pnode is not put before the function returns, it may cause a memory leak. Hence put pnode after its last occurrence. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lkml.kernel.org/r/20190804163151.6511-1-nishkadg.linux@gmail.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/st')
-rw-r--r--drivers/clk/st/clk-flexgen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c
index d18e49b4976f..4413b6e04a8e 100644
--- a/drivers/clk/st/clk-flexgen.c
+++ b/drivers/clk/st/clk-flexgen.c
@@ -326,6 +326,7 @@ static void __init st_of_flexgen_setup(struct device_node *np)
return;
reg = of_iomap(pnode, 0);
+ of_node_put(pnode);
if (!reg)
return;