Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-rc7 /net/xfrm/xfrm_hash.c

Filename:/net/xfrm/xfrm_hash.c
Lines Added:3
Lines Deleted:6
Also changed in: (Previous) 2.6.25-rc6  2.6.25-rc5  2.6.25-rc4  2.6.25-rc3  2.6.25-rc2  2.6.25-rc1 
(Following) 2.6.25-rc8  2.6.25-rc9  2.6.25 

Location
[  2.6.25-rc7
  [  net
    [  xfrm
       o  xfrm_hash.c

Patch

diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c
index 55ab579..a2023ec 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)
    struct hlist_head *n;
 
    if (sz <= PAGE_SIZE)
-      n = kmalloc(sz, GFP_KERNEL);
+      n = kzalloc(sz, GFP_KERNEL);
    else if (hashdist)
-      n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL);
+      n = __vmalloc(sz, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
    else
       n = (struct hlist_head *)
-         __get_free_pages(GFP_KERNEL | __GFP_NOWARN,
+         __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
                 get_order(sz));
 
-   if (n)
-      memset(n, 0, sz);
-
    return n;
 }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.