aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-04-19 14:15:21 -0400
committerStephen Boyd <sboyd@codeaurora.org>2017-04-21 22:49:13 -0400
commit23826e240ad82727635eb84fff1211dd2ff750fb (patch)
tree9057cae4e1374fb42d3d3ef3c8760fcb1c443b3d
parent24f8186eb8d69a3a0d856ce59fb4f19ae23ff23a (diff)
clk: mvebu: Use kcalloc() in of_cpu_clk_setup()
Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r--drivers/clk/mvebu/clk-cpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c
index 044892b6534d..072aa38374ce 100644
--- a/drivers/clk/mvebu/clk-cpu.c
+++ b/drivers/clk/mvebu/clk-cpu.c
@@ -186,11 +186,11 @@ static void __init of_cpu_clk_setup(struct device_node *node)
186 for_each_node_by_type(dn, "cpu") 186 for_each_node_by_type(dn, "cpu")
187 ncpus++; 187 ncpus++;
188 188
189 cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); 189 cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL);
190 if (WARN_ON(!cpuclk)) 190 if (WARN_ON(!cpuclk))
191 goto cpuclk_out; 191 goto cpuclk_out;
192 192
193 clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); 193 clks = kcalloc(ncpus, sizeof(*clks), GFP_KERNEL);
194 if (WARN_ON(!clks)) 194 if (WARN_ON(!clks))
195 goto clks_out; 195 goto clks_out;
196 196