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>
This commit is contained in:
parent
24f8186eb8
commit
23826e240a
|
@ -186,11 +186,11 @@ static void __init of_cpu_clk_setup(struct device_node *node)
|
||||||
for_each_node_by_type(dn, "cpu")
|
for_each_node_by_type(dn, "cpu")
|
||||||
ncpus++;
|
ncpus++;
|
||||||
|
|
||||||
cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL);
|
cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL);
|
||||||
if (WARN_ON(!cpuclk))
|
if (WARN_ON(!cpuclk))
|
||||||
goto cpuclk_out;
|
goto cpuclk_out;
|
||||||
|
|
||||||
clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL);
|
clks = kcalloc(ncpus, sizeof(*clks), GFP_KERNEL);
|
||||||
if (WARN_ON(!clks))
|
if (WARN_ON(!clks))
|
||||||
goto clks_out;
|
goto clks_out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue