From: Fabian Frederick Date: Fri, 14 Nov 2014 18:38:23 +0000 (+0100) Subject: net: dsa: replace count*size kzalloc by kcalloc X-Git-Tag: firefly_0821_release~176^2~2717^2~183 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6f2aed6ad7242ead0db1278b4b48fabb81bbc6a7;p=firefly-linux-kernel-4.4.55.git net: dsa: replace count*size kzalloc by kcalloc kcalloc manages count*sizeof overflow. Signed-off-by: Fabian Frederick Signed-off-by: David S. Miller --- 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;