summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-11-14 21:36:42 +0300
committerDavid S. Miller <davem@davemloft.net>2014-11-16 22:41:39 +0300
commit5bc4b46a70eab74d642c726d99433166d3f65e45 (patch)
treee3f0c57d4f8a3f5299d1eaeae9644f8e7e516f9d
parentf35423c137b0e64155f52c166db1d13834a551f2 (diff)
downloadlinux-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.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;