All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Efremov <efremov@linux.com>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Denis Efremov <efremov@linux.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] w1: Use kzfree() in w1_master_release()
Date: Thu,  4 Jun 2020 15:56:17 +0300	[thread overview]
Message-ID: <20200604125617.100046-1-efremov@linux.com> (raw)

Use kzfree() instead of memset() with 0 followed by kfree().
The pointer is allocated in w1_alloc_dev().

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/w1/w1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index e58c7592008d..24baacf8314c 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -71,8 +71,7 @@ static void w1_master_release(struct device *dev)
 	struct w1_master *md = dev_to_w1_master(dev);
 
 	dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name);
-	memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master));
-	kfree(md);
+	kzfree(md);
 }
 
 static void w1_slave_release(struct device *dev)
-- 
2.26.2


                 reply	other threads:[~2020-06-04 12:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200604125617.100046-1-efremov@linux.com \
    --to=efremov@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.