aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorJoonwoo Park <joonwpark81@gmail.com>2007-11-26 10:23:21 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:05 -0500
commitdcaee95a1b396f85cdc28099f39710be328d3a5e (patch)
tree2408c1ad351b4a12c2ab2423cd854cc67f4f4da8 /net/xfrm
parent8512430e554a84275669f78f86dce18566d5cf7a (diff)
[IPSEC]: kmalloc + memset conversion to kzalloc
2007/11/26, Patrick McHardy <kaber@trash.net>: > How about also switching vmalloc/get_free_pages to GFP_ZERO > and getting rid of the memset entirely while you're at it? > xfrm_hash: kmalloc + memset conversion to kzalloc fix to avoid memset entirely. Signed-off-by: Joonwoo Park <joonwpark81@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_hash.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c
index 55ab5792af56..a2023ec52329 100644
--- a/net/xfrm/xfrm_hash.c
+++ b/net/xfrm/xfrm_hash.c
@@ -17,17 +17,14 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz)
17 struct hlist_head *n; 17 struct hlist_head *n;
18 18
19 if (sz <= PAGE_SIZE) 19 if (sz <= PAGE_SIZE)
20 n = kmalloc(sz, GFP_KERNEL); 20 n = kzalloc(sz, GFP_KERNEL);
21 else if (hashdist) 21 else if (hashdist)
22 n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL); 22 n = __vmalloc(sz, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
23 else 23 else
24 n = (struct hlist_head *) 24 n = (struct hlist_head *)
25 __get_free_pages(GFP_KERNEL | __GFP_NOWARN, 25 __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
26 get_order(sz)); 26 get_order(sz));
27 27
28 if (n)
29 memset(n, 0, sz);
30
31 return n; 28 return n;
32} 29}
33 30