From: Denis Efremov <efremov@linux.com>
To: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: Denis Efremov <efremov@linux.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-hyperv@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: storvsc: Use kzfree() in storvsc_suspend()
Date: Thu, 4 Jun 2020 16:04:06 +0300 [thread overview]
Message-ID: <20200604130406.108940-1-efremov@linux.com> (raw)
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
next reply other threads:[~2020-06-04 13:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 13:04 Denis Efremov [this message]
2020-06-04 17:05 ` [PATCH] scsi: storvsc: Use kzfree() in storvsc_suspend() 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
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=20200604130406.108940-1-efremov@linux.com \
--to=efremov@linux.com \
--cc=jejb@linux.ibm.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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 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).