aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2019-09-03 22:39:12 -0400
committerDavid S. Miller <davem@davemloft.net>2019-09-05 06:06:04 -0400
commitda3a3b653b34fe8c623a0ade88cdf92eb9a35827 (patch)
treefefa0aba444561ec38fcf97688c2b85f59967a7a
parent60b3990c2cef8667a659e44accffc8da0144ea98 (diff)
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>
-rw-r--r--net/atm/mpoa_caches.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index 4bb418313720..3286f9d527d3 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -180,8 +180,7 @@ static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)
180static void in_cache_put(in_cache_entry *entry) 180static void in_cache_put(in_cache_entry *entry)
181{ 181{
182 if (refcount_dec_and_test(&entry->use)) { 182 if (refcount_dec_and_test(&entry->use)) {
183 memset(entry, 0, sizeof(in_cache_entry)); 183 kzfree(entry);
184 kfree(entry);
185 } 184 }
186} 185}
187 186
@@ -416,8 +415,7 @@ static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr,
416static void eg_cache_put(eg_cache_entry *entry) 415static void eg_cache_put(eg_cache_entry *entry)
417{ 416{
418 if (refcount_dec_and_test(&entry->use)) { 417 if (refcount_dec_and_test(&entry->use)) {
419 memset(entry, 0, sizeof(eg_cache_entry)); 418 kzfree(entry);
420 kfree(entry);
421 } 419 }
422} 420}
423 421