From d432d04560301c6350158dc4a7e8275b331fd480 Mon Sep 17 00:00:00 2001 From: Nishka Dasgupta Date: Sun, 4 Aug 2019 22:01:51 +0530 Subject: 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 Link: https://lkml.kernel.org/r/20190804163151.6511-1-nishkadg.linux@gmail.com Signed-off-by: Stephen Boyd --- drivers/clk/st/clk-flexgen.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/clk/st') 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; -- cgit v1.2.3