From 2afe37cdffa96f69c9096e6d4a10a275c9c7d2c9 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 21 Nov 2006 01:14:33 -0200 Subject: [ATM]: Use kmemdup & kzalloc where applicable Signed-off-by: Arnaldo Carvalho de Melo --- net/atm/mpoa_caches.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'net/atm/mpoa_caches.c') diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c index f3b99b38c91b..697a081533b5 100644 --- a/net/atm/mpoa_caches.c +++ b/net/atm/mpoa_caches.c @@ -87,7 +87,7 @@ static in_cache_entry *in_cache_get_by_vcc(struct atm_vcc *vcc, static in_cache_entry *in_cache_add_entry(__be32 dst_ip, struct mpoa_client *client) { - in_cache_entry* entry = kmalloc(sizeof(in_cache_entry), GFP_KERNEL); + in_cache_entry *entry = kzalloc(sizeof(in_cache_entry), GFP_KERNEL); if (entry == NULL) { printk("mpoa: mpoa_caches.c: new_in_cache_entry: out of memory\n"); @@ -95,7 +95,6 @@ static in_cache_entry *in_cache_add_entry(__be32 dst_ip, } dprintk("mpoa: mpoa_caches.c: adding an ingress entry, ip = %u.%u.%u.%u\n", NIPQUAD(dst_ip)); - memset(entry,0,sizeof(in_cache_entry)); atomic_set(&entry->use, 1); dprintk("mpoa: mpoa_caches.c: new_in_cache_entry: about to lock\n"); @@ -447,7 +446,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry, static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_client *client) { - eg_cache_entry *entry = kmalloc(sizeof(eg_cache_entry), GFP_KERNEL); + eg_cache_entry *entry = kzalloc(sizeof(eg_cache_entry), GFP_KERNEL); if (entry == NULL) { printk("mpoa: mpoa_caches.c: new_eg_cache_entry: out of memory\n"); @@ -455,7 +454,6 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, struct mpoa_cli } dprintk("mpoa: mpoa_caches.c: adding an egress entry, ip = %u.%u.%u.%u, this should be our IP\n", NIPQUAD(msg->content.eg_info.eg_dst_ip)); - memset(entry, 0, sizeof(eg_cache_entry)); atomic_set(&entry->use, 1); dprintk("mpoa: mpoa_caches.c: new_eg_cache_entry: about to lock\n"); -- cgit v1.2.3-59-g8ed1b