linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] w1: Use kzfree() in w1_master_release()
@ 2020-06-04 12:56 Denis Efremov
  0 siblings, 0 replies; only message in thread
From: Denis Efremov @ 2020-06-04 12:56 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: Denis Efremov, linux-kernel

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-04 12:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 12:56 [PATCH] w1: Use kzfree() in w1_master_release() Denis Efremov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).