projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bc4b46
)
net: dsa: replace count*size kzalloc by kcalloc
author
Fabian Frederick
<fabf@skynet.be>
Fri, 14 Nov 2014 18:38:23 +0000
(19:38 +0100)
committer
David S. Miller
<davem@davemloft.net>
Sun, 16 Nov 2014 19:41:39 +0000
(14:41 -0500)
kcalloc 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 c00cca3e1913a640aba050e45eb449d4dd246c9c..322c778487e7dd5f1276b84334838fb266241807 100644
(file)
--- a/
net/dsa/dsa.c
+++ b/
net/dsa/dsa.c
@@
-607,8
+607,8
@@
static int dsa_of_probe(struct platform_device *pdev)
if (pd->nr_chips > DSA_MAX_SWITCHES)
pd->nr_chips = DSA_MAX_SWITCHES;
- pd->chip = k
zalloc(pd->nr_chips *
sizeof(struct dsa_chip_data),
- GFP_KERNEL);
+ pd->chip = k
calloc(pd->nr_chips,
sizeof(struct dsa_chip_data),
+
GFP_KERNEL);
if (!pd->chip) {
ret = -ENOMEM;
goto out_free;