diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-11-14 18:36:42 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-16 19:41:39 (GMT) |
commit | 5bc4b46a70eab74d642c726d99433166d3f65e45 (patch) | |
tree | e3f0c57d4f8a3f5299d1eaeae9644f8e7e516f9d | |
parent | f35423c137b0e64155f52c166db1d13834a551f2 (diff) | |
download | linux-5bc4b46a70eab74d642c726d99433166d3f65e45.tar.xz |
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>
-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 4648f12..c00cca3 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, /* First time routing table allocation */ if (!cd->rtable) { - cd->rtable = kmalloc(pd->nr_chips * sizeof(s8), GFP_KERNEL); + cd->rtable = kmalloc_array(pd->nr_chips, sizeof(s8), + GFP_KERNEL); if (!cd->rtable) return -ENOMEM; |