Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: armada-xp: fix refcount leak in axp_clk_init()

The of_find_compatible_node() returns a node pointer with refcount
incremented, but there is the lack of use of the of_node_put() when
done. Add the missing of_node_put() to release the refcount.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Fixes: 0a11a6ae9437 ("clk: mvebu: armada-xp: maintain clock init order")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Yangtao Li and committed by
Stephen Boyd
db20a90a e7beeab9

+3 -1
+3 -1
drivers/clk/mvebu/armada-xp.c
··· 226 226 227 227 mvebu_coreclk_setup(np, &axp_coreclks); 228 228 229 - if (cgnp) 229 + if (cgnp) { 230 230 mvebu_clk_gating_setup(cgnp, axp_gating_desc); 231 + of_node_put(cgnp); 232 + } 231 233 } 232 234 CLK_OF_DECLARE(axp_clk, "marvell,armada-xp-core-clock", axp_clk_init);