Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dcaee95a1b396f85cdc28099f39710be328d3a5e
Commit:     dcaee95a1b396f85cdc28099f39710be328d3a5e
Parent:     8512430e554a84275669f78f86dce18566d5cf7a
Author:     Joonwoo Park <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 26 23:23:21 2007 +0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:55:05 2008 -0800

    [IPSEC]: kmalloc + memset conversion to kzalloc
    
    2007/11/26, Patrick McHardy <[EMAIL PROTECTED]>:
    > 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 <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/xfrm/xfrm_hash.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to