diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-11-14 18:38:23 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-16 19:41:39 (GMT) |
commit | 6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7 (patch) | |
tree | 0e58df673485f4171eb84758cbf1c2de8a5f7fce /net | |
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')
-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 c00cca3..322c778 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; |