summaryrefslogtreecommitdiff
path: root/drivers/clk/versatile
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-08-04 19:34:44 +0300
committerStephen Boyd <sboyd@kernel.org>2019-08-08 01:25:25 +0300
commit5911dba556cf41a14907ed04b5636cf852b17933 (patch)
tree2296aafb06a5f24258e79a5c4348db9b906bdaca /drivers/clk/versatile
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b (diff)
downloadlinux-5911dba556cf41a14907ed04b5636cf852b17933.tar.xz
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: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lkml.kernel.org/r/20190804163445.6862-1-nishkadg.linux@gmail.com Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/versatile')
-rw-r--r--drivers/clk/versatile/clk-versatile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/versatile/clk-versatile.c b/drivers/clk/versatile/clk-versatile.c
index 90bb0b041b7a..fd54d5c0251c 100644
--- a/drivers/clk/versatile/clk-versatile.c
+++ b/drivers/clk/versatile/clk-versatile.c
@@ -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;