OSDN Git Service

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)
committerStephen Boyd <sboyd@kernel.org>
Wed, 15 Sep 2021 01:25:16 +0000 (18:25 -0700)
commitaf9617b419f77cf0b99702a7b2b0519da0d27715
treedf8ae08daca247f9b4b5a0a54445a542723957e7
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
clk: mvebu: ap-cpu-clk: Fix a memory leak in error handling paths

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>
drivers/clk/mvebu/ap-cpu-clk.c