summaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-11-14 19:36:42 +0100
committerDavid S. Miller <davem@davemloft.net>2014-11-16 14:41:39 -0500
commit5bc4b46a70eab74d642c726d99433166d3f65e45 (patch)
treee3f0c57d4f8a3f5299d1eaeae9644f8e7e516f9d /net/dsa
parentf35423c137b0e64155f52c166db1d13834a551f2 (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')
-rw-r--r--net/dsa/dsa.c3
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,
/* 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;