mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] w1: Use kfree_sensitive() to clear memory safely
@ 2026-07-19 10:08 unassigned
  2026-07-19 14:14 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: unassigned @ 2026-07-19 10:08 UTC (permalink / raw)
  To: krzk; +Cc: linux-kernel, unassigned

---
 drivers/w1/w1.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 486f321eadc8..5afc7d6cb6cf 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -68,8 +68,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)
@@ -793,10 +792,7 @@ int w1_unref_slave(struct w1_slave *sl)
 
 		w1_family_notify(BUS_NOTIFY_DEL_DEVICE, sl);
 		device_unregister(&sl->dev);
-		#ifdef DEBUG
-		memset(sl, 0, sizeof(*sl));
-		#endif
-		kfree(sl);
+		kfree_sensitive(sl);
 	}
 	atomic_dec(&dev->refcnt);
 	mutex_unlock(&dev->list_mutex);
-- 
2.47.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] w1: Use kfree_sensitive() to clear memory safely
  2026-07-19 10:08 [PATCH 2/2] w1: Use kfree_sensitive() to clear memory safely unassigned
@ 2026-07-19 14:14 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-19 14:14 UTC (permalink / raw)
  To: unassigned; +Cc: linux-kernel

On 19/07/2026 12:08, unassigned wrote:
> ---
>  drivers/w1/w1.c | 8 ++------


Please follow submitting patches document.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-19 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-19 10:08 [PATCH 2/2] w1: Use kfree_sensitive() to clear memory safely unassigned
2026-07-19 14:14 ` Krzysztof Kozlowski

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®