]> git.baikalelectronics.ru Git - kernel.git/commit
clk: ti: dm814x: Add of_node_put() to prevent memory leak
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Sun, 4 Aug 2019 16:33:28 +0000 (22:03 +0530)
committerStephen Boyd <sboyd@kernel.org>
Wed, 7 Aug 2019 22:26:39 +0000 (15:26 -0700)
commitf2858cd830129375d32ebdc4c00a233907e33abf
tree54a27f7f28ed1f77ae4506a1e08542fe2c174fbb
parent29c34e1f0eed509a7a60d511f86f9b83b653365c
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>
drivers/clk/ti/clk-814x.c