[patch 8/8] atm: use kzfree()
From: Johannes Weiner
Date: Mon Feb 16 2009 - 10:07:39 EST
Use kzfree() instead of memset() + kfree().
Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Chas Williams <chas@xxxxxxxxxxxxxxxx>
---
net/atm/mpoa_caches.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -167,11 +167,8 @@ static int cache_hit(in_cache_entry *ent
static void in_cache_put(in_cache_entry *entry)
{
- if (atomic_dec_and_test(&entry->use)) {
- memset(entry, 0, sizeof(in_cache_entry));
- kfree(entry);
- }
-
+ if (atomic_dec_and_test(&entry->use))
+ kzfree(entry);
return;
}
@@ -403,11 +400,8 @@ static eg_cache_entry *eg_cache_get_by_s
static void eg_cache_put(eg_cache_entry *entry)
{
- if (atomic_dec_and_test(&entry->use)) {
- memset(entry, 0, sizeof(eg_cache_entry));
- kfree(entry);
- }
-
+ if (atomic_dec_and_test(&entry->use))
+ kzfree(entry);
return;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/