diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-10 08:46:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-10 08:46:00 -0700 |
commit | 460fbf82c0842cad3f3c744c4dcb81978b7829f3 (patch) | |
tree | d19b6d7d18491a8fa423f3ac9f2b422863b8c373 /net/core/neighbour.c | |
parent | 68491d5892defca59ad4f604cace2b1e30889c14 (diff) | |
parent | b1a7ffcb7a047e99ab02424e651e0492f36095f7 (diff) | |
download | linux-460fbf82c0842cad3f3c744c4dcb81978b7829f3.tar.bz2 |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (35 commits)
[IPV6]: Deinline few large functions in inet6 code
[IPV4] ip_fragment: Always compute hash with ipfrag_lock held.
[NETFILTER]: Fix DNAT in LOCAL_OUT
[X25]: Restore skb->dev setting in x25_type_trans().
[NET]: Fix hotplug race during device registration.
[IPV6]: Unexport secure_ipv6_port_ephemeral
[NETFILTER]: Fix build with CONFIG_NETFILTER=y/m on IA64
[NET]: More kzalloc conversions.
[NET] kzalloc: use in alloc_netdev
[PKT_SCHED] act_police: Rename methods.
[TG3]: Speed up SRAM access (2nd version)
[TG3]: Kill some less useful flags
[NETFILTER]: H.323 helper: remove changelog
[NETFILTER]: Convert conntrack/ipt_REJECT to new checksumming functions
[NETFILTER]: Add address family specific checksum helpers
[NETFILTER]: Introduce infrastructure for address family specific operations
[NETFILTER]: Fix IP_NF_CONNTRACK_NETLINK dependency
[NETFILTER]: H.323 helper: add parameter 'default_rrq_ttl'
[NETFILTER]: H.323 helper: make get_h245_addr() static
[NETFILTER]: H.323 helper: change EXPORT_SYMBOL to EXPORT_SYMBOL_GPL
...
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 0c8666872d10..2ec8693fb778 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -284,14 +284,11 @@ static struct neighbour **neigh_hash_alloc(unsigned int entries) struct neighbour **ret; if (size <= PAGE_SIZE) { - ret = kmalloc(size, GFP_ATOMIC); + ret = kzalloc(size, GFP_ATOMIC); } else { ret = (struct neighbour **) - __get_free_pages(GFP_ATOMIC, get_order(size)); + __get_free_pages(GFP_ATOMIC|__GFP_ZERO, get_order(size)); } - if (ret) - memset(ret, 0, size); - return ret; } @@ -1089,8 +1086,7 @@ static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst, if (hh->hh_type == protocol) break; - if (!hh && (hh = kmalloc(sizeof(*hh), GFP_ATOMIC)) != NULL) { - memset(hh, 0, sizeof(struct hh_cache)); + if (!hh && (hh = kzalloc(sizeof(*hh), GFP_ATOMIC)) != NULL) { rwlock_init(&hh->hh_lock); hh->hh_type = protocol; atomic_set(&hh->hh_refcnt, 0); @@ -1366,13 +1362,11 @@ void neigh_table_init(struct neigh_table *tbl) tbl->hash_buckets = neigh_hash_alloc(tbl->hash_mask + 1); phsize = (PNEIGH_HASHMASK + 1) * sizeof(struct pneigh_entry *); - tbl->phash_buckets = kmalloc(phsize, GFP_KERNEL); + tbl->phash_buckets = kzalloc(phsize, GFP_KERNEL); if (!tbl->hash_buckets || !tbl->phash_buckets) panic("cannot allocate neighbour cache hashes"); - memset(tbl->phash_buckets, 0, phsize); - get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd)); rwlock_init(&tbl->lock); |