Commit d432d045 authored by Nishka Dasgupta's avatar Nishka Dasgupta Committed by Stephen Boyd

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: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lkml.kernel.org/r/20190804163151.6511-1-nishkadg.linux@gmail.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent d55841ce
...@@ -326,6 +326,7 @@ static void __init st_of_flexgen_setup(struct device_node *np) ...@@ -326,6 +326,7 @@ static void __init st_of_flexgen_setup(struct device_node *np)
return; return;
reg = of_iomap(pnode, 0); reg = of_iomap(pnode, 0);
of_node_put(pnode);
if (!reg) if (!reg)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment