summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-04-19 13:43:03 -0400
committerStephen Boyd <sboyd@codeaurora.org>2017-04-21 22:20:34 -0400
commit1e5c844441e6dbf2e2433384ac835b712c35c533 (patch)
tree6b134b6b81c441bd5a33b6a403ffe2d8a4c23ced /drivers/clk
parent7c2adaf11036654e4a5f5da0bf09916901f3e1ec (diff)
clk: at91: Use kcalloc() in of_at91_clk_pll_get_characteristics()
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/at91/clk-pll.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c
index 45ad168e1496..7d3223fc7161 100644
--- a/drivers/clk/at91/clk-pll.c
+++ b/drivers/clk/at91/clk-pll.c
@@ -399,18 +399,18 @@ of_at91_clk_pll_get_characteristics(struct device_node *np)
399 if (!characteristics) 399 if (!characteristics)
400 return NULL; 400 return NULL;
401 401
402 output = kzalloc(sizeof(*output) * num_output, GFP_KERNEL); 402 output = kcalloc(num_output, sizeof(*output), GFP_KERNEL);
403 if (!output) 403 if (!output)
404 goto out_free_characteristics; 404 goto out_free_characteristics;
405 405
406 if (num_cells > 2) { 406 if (num_cells > 2) {
407 out = kzalloc(sizeof(*out) * num_output, GFP_KERNEL); 407 out = kcalloc(num_output, sizeof(*out), GFP_KERNEL);
408 if (!out) 408 if (!out)
409 goto out_free_output; 409 goto out_free_output;
410 } 410 }
411 411
412 if (num_cells > 3) { 412 if (num_cells > 3) {
413 icpll = kzalloc(sizeof(*icpll) * num_output, GFP_KERNEL); 413 icpll = kcalloc(num_output, sizeof(*icpll), GFP_KERNEL);
414 if (!icpll) 414 if (!icpll)
415 goto out_free_output; 415 goto out_free_output;
416 } 416 }