Skip to content

Commit

Permalink
net: mpoa: Use kzfree rather than its implementation.
Browse files Browse the repository at this point in the history
Use kzfree instead of memset() + kfree().

Signed-off-by: zhong jiang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xiongzhongjiang authored and davem330 committed Sep 5, 2019
1 parent 60b3990 commit da3a3b6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/atm/mpoa_caches.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)
static void in_cache_put(in_cache_entry *entry)
{
if (refcount_dec_and_test(&entry->use)) {
memset(entry, 0, sizeof(in_cache_entry));
kfree(entry);
kzfree(entry);
}
}

Expand Down Expand Up @@ -416,8 +415,7 @@ static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr,
static void eg_cache_put(eg_cache_entry *entry)
{
if (refcount_dec_and_test(&entry->use)) {
memset(entry, 0, sizeof(eg_cache_entry));
kfree(entry);
kzfree(entry);
}
}

Expand Down

0 comments on commit da3a3b6

Please sign in to comment.