lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] w1: use kfree_sensitive() instead of kfree()
Date
From: Wang Qing <wangqing@vivo.com>

use kfree_sensitive() derictly instead of memset zero and kfree().

Signed-off-by: Wang Qing <wangqing@vivo.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 f2ae2e5..a0a6c3c
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -73,8 +73,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);
+ kfree_sensitive(md);
}

static void w1_slave_release(struct device *dev)
--
2.7.4
\
 
 \ /
  Last update: 2021-10-20 09:24    [W:0.051 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site