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

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: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lkml.kernel.org/r/20190804163328.6693-1-nishkadg.linux@gmail.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent d432d045
...@@ -66,6 +66,7 @@ static int __init dm814x_adpll_early_init(void) ...@@ -66,6 +66,7 @@ static int __init dm814x_adpll_early_init(void)
} }
of_platform_populate(np, NULL, NULL, NULL); of_platform_populate(np, NULL, NULL, NULL);
of_node_put(np);
return 0; return 0;
} }
......
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