diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-11-14 21:38:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-16 22:41:39 +0300 |
commit | 6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7 (patch) | |
tree | 0e58df673485f4171eb84758cbf1c2de8a5f7fce /net/dsa/dsa.c | |
parent | 5bc4b46a70eab74d642c726d99433166d3f65e45 (diff) | |
download | linux-6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7.tar.xz |
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/dsa.c')
-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; |