]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
clk: mvebu: ap-cpu-clk: Fix a memory leak in error handling paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 23 Apr 2021 07:02:26 +0000 (09:02 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:27 +0000 (09:48 +0100)
commitdfd754884224ce33df28a5f8064bb774b42dcd5d
tree2d1150c0567ec2c51b53ca0e1b314e7904e65bb1
parent1fa61604f95f1cfa747a142198eb893948b58333
clk: mvebu: ap-cpu-clk: Fix a memory leak in error handling paths

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit af9617b419f77cf0b99702a7b2b0519da0d27715 ]

If we exit the for_each_of_cpu_node loop early, the reference on the
current node must be decremented, otherwise there is a leak.

Fixes: f756e362d938 ("clk: mvebu: add CPU clock driver for Armada 7K/8K")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/545df946044fc1fc05a4217cdf0054be7a79e49e.1619161112.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/clk/mvebu/ap-cpu-clk.c