aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 33ec96001d90..ec9b0dde9f9c 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)
605static struct hlist_head *fib_hash_alloc(int bytes) 605static struct hlist_head *fib_hash_alloc(int bytes)
606{ 606{
607 if (bytes <= PAGE_SIZE) 607 if (bytes <= PAGE_SIZE)
608 return kmalloc(bytes, GFP_KERNEL); 608 return kzalloc(bytes, GFP_KERNEL);
609 else 609 else
610 return (struct hlist_head *) 610 return (struct hlist_head *)
611 __get_free_pages(GFP_KERNEL, get_order(bytes)); 611 __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(bytes));
612} 612}
613 613
614static void fib_hash_free(struct hlist_head *hash, int bytes) 614static void fib_hash_free(struct hlist_head *hash, int bytes)
@@ -712,12 +712,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
712 if (!new_info_hash || !new_laddrhash) { 712 if (!new_info_hash || !new_laddrhash) {
713 fib_hash_free(new_info_hash, bytes); 713 fib_hash_free(new_info_hash, bytes);
714 fib_hash_free(new_laddrhash, bytes); 714 fib_hash_free(new_laddrhash, bytes);
715 } else { 715 } else
716 memset(new_info_hash, 0, bytes);
717 memset(new_laddrhash, 0, bytes);
718
719 fib_hash_move(new_info_hash, new_laddrhash, new_size); 716 fib_hash_move(new_info_hash, new_laddrhash, new_size);
720 }
721 717
722 if (!fib_hash_size) 718 if (!fib_hash_size)
723 goto failure; 719 goto failure;