diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | 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 0dfee27cfbcd..eb1aa8eead09 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) | |||
102 | unsigned long size = divisor * sizeof(struct hlist_head); | 102 | unsigned long size = divisor * sizeof(struct hlist_head); |
103 | 103 | ||
104 | if (size <= PAGE_SIZE) { | 104 | if (size <= PAGE_SIZE) { |
105 | return kmalloc(size, GFP_KERNEL); | 105 | return kzalloc(size, GFP_KERNEL); |
106 | } else { | 106 | } else { |
107 | return (struct hlist_head *) | 107 | return (struct hlist_head *) |
108 | __get_free_pages(GFP_KERNEL, get_order(size)); | 108 | __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(size)); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
@@ -174,8 +174,6 @@ static void fn_rehash_zone(struct fn_zone *fz) | |||
174 | ht = fz_hash_alloc(new_divisor); | 174 | ht = fz_hash_alloc(new_divisor); |
175 | 175 | ||
176 | if (ht) { | 176 | if (ht) { |
177 | memset(ht, 0, new_divisor * sizeof(struct hlist_head)); | ||
178 | |||
179 | write_lock_bh(&fib_hash_lock); | 177 | write_lock_bh(&fib_hash_lock); |
180 | old_ht = fz->fz_hash; | 178 | old_ht = fz->fz_hash; |
181 | fz->fz_hash = ht; | 179 | fz->fz_hash = ht; |
@@ -219,7 +217,6 @@ fn_new_zone(struct fn_hash *table, int z) | |||
219 | kfree(fz); | 217 | kfree(fz); |
220 | return NULL; | 218 | return NULL; |
221 | } | 219 | } |
222 | memset(fz->fz_hash, 0, fz->fz_divisor * sizeof(struct hlist_head *)); | ||
223 | fz->fz_order = z; | 220 | fz->fz_order = z; |
224 | fz->fz_mask = inet_make_mask(z); | 221 | fz->fz_mask = inet_make_mask(z); |
225 | 222 | ||