summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorMarkus Elfring2017-04-19 20:15:21 +0200
committerStephen Boyd2017-04-22 04:49:13 +0200
commit23826e240ad82727635eb84fff1211dd2ff750fb (patch)
tree9057cae4e1374fb42d3d3ef3c8760fcb1c443b3d /drivers/clk
parentclk: nomadik: Delete error messages for a failed memory allocation in two fun... (diff)
downloadkernel-qcow2-linux-23826e240ad82727635eb84fff1211dd2ff750fb.tar.gz
kernel-qcow2-linux-23826e240ad82727635eb84fff1211dd2ff750fb.tar.xz
kernel-qcow2-linux-23826e240ad82727635eb84fff1211dd2ff750fb.zip
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>
Diffstat (limited to 'drivers/clk')
-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)
for_each_node_by_type(dn, "cpu")
ncpus++;
- cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL);
+ cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL);
if (WARN_ON(!cpuclk))
goto cpuclk_out;
- clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL);
+ clks = kcalloc(ncpus, sizeof(*clks), GFP_KERNEL);
if (WARN_ON(!clks))
goto clks_out;