Commit 6f2aed6a authored by Fabian Frederick's avatar Fabian Frederick Committed by David S. Miller

net: dsa: replace count*size kzalloc by kcalloc

kcalloc manages count*sizeof overflow.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5bc4b46a
...@@ -607,8 +607,8 @@ static int dsa_of_probe(struct platform_device *pdev) ...@@ -607,8 +607,8 @@ static int dsa_of_probe(struct platform_device *pdev)
if (pd->nr_chips > DSA_MAX_SWITCHES) if (pd->nr_chips > DSA_MAX_SWITCHES)
pd->nr_chips = DSA_MAX_SWITCHES; pd->nr_chips = DSA_MAX_SWITCHES;
pd->chip = kzalloc(pd->nr_chips * sizeof(struct dsa_chip_data), pd->chip = kcalloc(pd->nr_chips, sizeof(struct dsa_chip_data),
GFP_KERNEL); GFP_KERNEL);
if (!pd->chip) { if (!pd->chip) {
ret = -ENOMEM; ret = -ENOMEM;
goto out_free; goto out_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment