Commit 5911dba5 authored by Nishka Dasgupta's avatar Nishka Dasgupta Committed by Stephen Boyd

clk: versatile: Add of_node_put() in cm_osc_setup()

In function cm_osc_setup, variable parent takes the value returned by
of_get_parent, which gets a node but does not put it. If parent is not
put before it goes out of scope, it may cause a memory leak.
Hence put parent before the function terminates.
Issue found with Coccinelle.
Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lkml.kernel.org/r/20190804163445.6862-1-nishkadg.linux@gmail.comReviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 5f9e832c
......@@ -70,6 +70,7 @@ static void __init cm_osc_setup(struct device_node *np,
return;
}
cm_base = of_iomap(parent, 0);
of_node_put(parent);
if (!cm_base) {
pr_err("could not remap core module base\n");
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