diff options
author | Joonwoo Park <joonwpark81@gmail.com> | 2007-11-26 23:29:32 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:55:06 -0800 |
commit | 88f8349164cf4035e63db9e6f484e0ce9cb17e47 (patch) | |
tree | 48f731ce82b84ebd88a86a58be0e1cc69a7dcd90 /net/ipv4/fib_semantics.c | |
parent | dcaee95a1b396f85cdc28099f39710be328d3a5e (diff) | |
download | kernel_samsung_tuna-88f8349164cf4035e63db9e6f484e0ce9cb17e47.zip kernel_samsung_tuna-88f8349164cf4035e63db9e6f484e0ce9cb17e47.tar.gz kernel_samsung_tuna-88f8349164cf4035e63db9e6f484e0ce9cb17e47.tar.bz2 |
[IPV4] fib_semantics: kmalloc + memset conversion to kzalloc
fib_semantics: 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/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 33ec960..ec9b0dd 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -605,10 +605,10 @@ static inline unsigned int fib_laddr_hashfn(__be32 val) static struct hlist_head *fib_hash_alloc(int bytes) { if (bytes <= PAGE_SIZE) - return kmalloc(bytes, GFP_KERNEL); + return kzalloc(bytes, GFP_KERNEL); else return (struct hlist_head *) - __get_free_pages(GFP_KERNEL, get_order(bytes)); + __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(bytes)); } static void fib_hash_free(struct hlist_head *hash, int bytes) @@ -712,12 +712,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg) if (!new_info_hash || !new_laddrhash) { fib_hash_free(new_info_hash, bytes); fib_hash_free(new_laddrhash, bytes); - } else { - memset(new_info_hash, 0, bytes); - memset(new_laddrhash, 0, bytes); - + } else fib_hash_move(new_info_hash, new_laddrhash, new_size); - } if (!fib_hash_size) goto failure; |