mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>, <anna.schumaker@netapp.com>,
	<trond.myklebust@hammerspace.com>
Cc: <zhongjiang@huawei.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] net: mpoa: Use kzfree rather than its implementation.
Date: Wed, 4 Sep 2019 10:39:12 +0800	[thread overview]
Message-ID: <1567564752-6430-4-git-send-email-zhongjiang@huawei.com> (raw)
In-Reply-To: <1567564752-6430-1-git-send-email-zhongjiang@huawei.com>

Use kzfree instead of memset() + kfree().

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/atm/mpoa_caches.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index 4bb4183..3286f9d 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)
 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);
 	}
 }
 
@@ -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);
 	}
 }
 
-- 
1.7.12.4


  parent reply	other threads:[~2019-09-04  2:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  2:39 [PATCH 0/3] net: Use kzfree() directly zhong jiang
2019-09-04  2:39 ` [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation zhong jiang
2019-09-17  2:43   ` Jakub Kicinski
2019-09-17  3:19     ` zhong jiang
2019-09-04  2:39 ` [PATCH 2/3] sunrpc: Use kzfree " zhong jiang
2019-09-04  2:39 ` zhong jiang [this message]
2019-09-05 10:06 ` [PATCH 0/3] net: Use kzfree() directly David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1567564752-6430-4-git-send-email-zhongjiang@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=anna.schumaker@netapp.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®