projects
/
linux-2.6-microblaze.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
|
history
diff --git
a/net/dsa/dsa.c
b/net/dsa/dsa.c
index
4648f12
..
c00cca3
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;