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

    [IPV4] fib_hash: kmalloc + memset conversion to kzalloc
    
    fib_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/ipv4/fib_hash.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 0dfee27..eb1aa8e 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -102,10 +102,10 @@ static struct hlist_head *fz_hash_alloc(int divisor)
        unsigned long size = divisor * sizeof(struct hlist_head);
 
        if (size <= PAGE_SIZE) {
-               return kmalloc(size, GFP_KERNEL);
+               return kzalloc(size, GFP_KERNEL);
        } else {
                return (struct hlist_head *)
-                       __get_free_pages(GFP_KERNEL, get_order(size));
+                       __get_free_pages(GFP_KERNEL | __GFP_ZERO, 
get_order(size));
        }
 }
 
@@ -174,8 +174,6 @@ static void fn_rehash_zone(struct fn_zone *fz)
        ht = fz_hash_alloc(new_divisor);
 
        if (ht) {
-               memset(ht, 0, new_divisor * sizeof(struct hlist_head));
-
                write_lock_bh(&fib_hash_lock);
                old_ht = fz->fz_hash;
                fz->fz_hash = ht;
@@ -219,7 +217,6 @@ fn_new_zone(struct fn_hash *table, int z)
                kfree(fz);
                return NULL;
        }
-       memset(fz->fz_hash, 0, fz->fz_divisor * sizeof(struct hlist_head *));
        fz->fz_order = z;
        fz->fz_mask = inet_make_mask(z);
 
-
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