diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-11-14 13:36:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-16 14:41:39 -0500 |
commit | 5bc4b46a70eab74d642c726d99433166d3f65e45 (patch) | |
tree | e3f0c57d4f8a3f5299d1eaeae9644f8e7e516f9d /net/dsa/dsa.c | |
parent | f35423c137b0e64155f52c166db1d13834a551f2 (diff) |
net: dsa: replace count*size kmalloc by kmalloc_array
kmalloc_array 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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 4648f12098ad..c00cca3e1913 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -526,7 +526,8 @@ static int dsa_of_setup_routing_table(struct dsa_platform_data *pd, | |||
526 | 526 | ||
527 | /* First time routing table allocation */ | 527 | /* First time routing table allocation */ |
528 | if (!cd->rtable) { | 528 | if (!cd->rtable) { |
529 | cd->rtable = kmalloc(pd->nr_chips * sizeof(s8), GFP_KERNEL); | 529 | cd->rtable = kmalloc_array(pd->nr_chips, sizeof(s8), |
530 | GFP_KERNEL); | ||
530 | if (!cd->rtable) | 531 | if (!cd->rtable) |
531 | return -ENOMEM; | 532 | return -ENOMEM; |
532 | 533 | ||