diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-11-14 19:38:23 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-16 20:41:39 +0100 |
commit | 6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7 (patch) | |
tree | 0e58df673485f4171eb84758cbf1c2de8a5f7fce /net/dsa | |
parent | net: dsa: replace count*size kmalloc by kmalloc_array (diff) | |
download | linux-6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7.tar.xz linux-6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7.zip |
net: dsa: replace count*size kzalloc by kcalloc
kcalloc manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index c00cca3e1913..322c778487e7 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -607,8 +607,8 @@ static int dsa_of_probe(struct platform_device *pdev) if (pd->nr_chips > DSA_MAX_SWITCHES) pd->nr_chips = DSA_MAX_SWITCHES; - pd->chip = kzalloc(pd->nr_chips * sizeof(struct dsa_chip_data), - GFP_KERNEL); + pd->chip = kcalloc(pd->nr_chips, sizeof(struct dsa_chip_data), + GFP_KERNEL); if (!pd->chip) { ret = -ENOMEM; goto out_free; |