projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f35423c
)
net: dsa: replace count*size kmalloc by kmalloc_array
author
Fabian Frederick
<fabf@skynet.be>
Fri, 14 Nov 2014 18:36:42 +0000
(19:36 +0100)
committer
David S. Miller
<davem@davemloft.net>
Sun, 16 Nov 2014 19:41:39 +0000
(14:41 -0500)
kmalloc_array manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa.c
patch
|
blob
|
blame
|
history
diff --git
a/net/dsa/dsa.c
b/net/dsa/dsa.c
index 4648f12098ad6490f44f2446c4a9c67323e2fbef..c00cca3e1913a640aba050e45eb449d4dd246c9c 100644
(file)
--- 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;