clk: si5351: Use devm_kcalloc() in si5351_i2c_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 19 Apr 2017 20:37:30 +0000 (22:37 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Sat, 22 Apr 2017 02:44:42 +0000 (19:44 -0700)
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>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk-si5351.c

index b051db43fae1995f536bbf732b3a1729a6d214b0..a4c009e1e70de5a1e3b85d3004cc77db08478c55 100644 (file)
@@ -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;