Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1627195
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/8] clk: si5351: Use devm_kcalloc() in si5351_i2c_probe() |
| Date | 2017-04-20 10:30 +0200 |
| Message-ID | <tyfDs-6zX-17@gated-at.bofh.it> (permalink) |
| References | <tyfDr-6zX-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 19 Apr 2017 22:37:30 +0200 Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "devm_kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/clk/clk-si5351.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c index b051db43fae1..a4c009e1e70d 100644 --- a/drivers/clk/clk-si5351.c +++ b/drivers/clk/clk-si5351.c @@ -1535,9 +1535,9 @@ static int si5351_i2c_probe(struct i2c_client *client, else parent_names[1] = si5351_pll_names[1]; - drvdata->msynth = devm_kzalloc(&client->dev, num_clocks * + drvdata->msynth = devm_kcalloc(&client->dev, num_clocks, sizeof(*drvdata->msynth), GFP_KERNEL); - drvdata->clkout = devm_kzalloc(&client->dev, num_clocks * + drvdata->clkout = devm_kcalloc(&client->dev, num_clocks, sizeof(*drvdata->clkout), GFP_KERNEL); drvdata->num_clkout = num_clocks; -- 2.12.2
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH 1/8] clk: si5351: Use devm_kcalloc() in si5351_i2c_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-20 10:30 +0200 Re: [PATCH 1/8] clk: si5351: Use devm_kcalloc() in si5351_i2c_probe() Stephen Boyd <sboyd@codeaurora.org> - 2017-04-22 04:50 +0200
csiph-web