linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: storvsc: Use kzfree() in storvsc_suspend()
@ 2020-06-04 13:04 Denis Efremov
  2020-06-04 17:05 ` Dexuan-Linux Cui
  0 siblings, 1 reply; 8+ messages in thread
From: Denis Efremov @ 2020-06-04 13:04 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Denis Efremov, Martin K. Petersen, linux-hyperv, linux-scsi,
	linux-kernel

Use kzfree() instead of memset() with 0 followed by kfree().

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/scsi/storvsc_drv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 072ed8728657..e5a19cd8a450 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -2035,10 +2035,7 @@ static int storvsc_suspend(struct hv_device *hv_dev)
 
 	vmbus_close(hv_dev->channel);
 
-	memset(stor_device->stor_chns, 0,
-	       num_possible_cpus() * sizeof(void *));
-
-	kfree(stor_device->stor_chns);
+	kzfree(stor_device->stor_chns);
 	stor_device->stor_chns = NULL;
 
 	cpumask_clear(&stor_device->alloced_cpus);
-- 
2.26.2


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

end of thread, other threads:[~2020-06-10  2:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 13:04 [PATCH] scsi: storvsc: Use kzfree() in storvsc_suspend() Denis Efremov
2020-06-04 17:05 ` Dexuan-Linux Cui
2020-06-04 21:43   ` Denis Efremov
2020-06-04 21:49     ` Dexuan Cui
2020-06-04 21:51       ` Dexuan Cui
2020-06-05  7:59   ` [PATCH] scsi: storvsc: Remove memset before memory freeing " Denis Efremov
2020-06-05  8:07     ` Dexuan Cui
2020-06-10  2:02     ` Martin K. Petersen

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).