mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 23:36:23 +09:00
net: mpoa: Use kzfree rather than its implementation.
Use kzfree instead of memset() + kfree(). Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
60b3990c2c
commit
da3a3b653b
|
@ -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)
|
static void in_cache_put(in_cache_entry *entry)
|
||||||
{
|
{
|
||||||
if (refcount_dec_and_test(&entry->use)) {
|
if (refcount_dec_and_test(&entry->use)) {
|
||||||
memset(entry, 0, sizeof(in_cache_entry));
|
kzfree(entry);
|
||||||
kfree(entry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
static void eg_cache_put(eg_cache_entry *entry)
|
||||||
{
|
{
|
||||||
if (refcount_dec_and_test(&entry->use)) {
|
if (refcount_dec_and_test(&entry->use)) {
|
||||||
memset(entry, 0, sizeof(eg_cache_entry));
|
kzfree(entry);
|
||||||
kfree(entry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user