summaryrefslogtreecommitdiff
path: root/drivers/clk/ti/clk-814x.c
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-08-04 19:33:28 +0300
committerStephen Boyd <sboyd@kernel.org>2019-08-08 01:26:39 +0300
commitb684702f6e471d5e7dd80dfbb926489b87f60bd8 (patch)
tree54a27f7f28ed1f77ae4506a1e08542fe2c174fbb /drivers/clk/ti/clk-814x.c
parentd432d04560301c6350158dc4a7e8275b331fd480 (diff)
downloadlinux-b684702f6e471d5e7dd80dfbb926489b87f60bd8.tar.xz
clk: ti: dm814x: Add of_node_put() to prevent memory leak
In function dm814x_adpll_early_init, variable np takes the value returned by of_find_node_by_name, which gets a node but does not put it. If np is not put before return, it may cause a memory leak. Hence put np before return. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lkml.kernel.org/r/20190804163328.6693-1-nishkadg.linux@gmail.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/ti/clk-814x.c')
-rw-r--r--drivers/clk/ti/clk-814x.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/ti/clk-814x.c b/drivers/clk/ti/clk-814x.c
index e8cee6f3b4a0..087cfa75ac24 100644
--- a/drivers/clk/ti/clk-814x.c
+++ b/drivers/clk/ti/clk-814x.c
@@ -66,6 +66,7 @@ static int __init dm814x_adpll_early_init(void)
}
of_platform_populate(np, NULL, NULL, NULL);
+ of_node_put(np);
return 0;
}