All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] scsi: qedf: use vzalloc() instead of vmalloc() and memset(0)
@ 2020-09-16  6:21 Qinglang Miao
  0 siblings, 0 replies; only message in thread
From: Qinglang Miao @ 2020-09-16  6:21 UTC (permalink / raw)
  To: Saurav Kashyap, Javed Hasan, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Qinglang Miao

Use vzalloc() instead of vmalloc() and memset(0) to clean the code.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/scsi/qedf/qedf_dbg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_dbg.c b/drivers/scsi/qedf/qedf_dbg.c
index e0387e495..0d2aed828 100644
--- a/drivers/scsi/qedf/qedf_dbg.c
+++ b/drivers/scsi/qedf/qedf_dbg.c
@@ -106,11 +106,10 @@ qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
 int
 qedf_alloc_grc_dump_buf(u8 **buf, uint32_t len)
 {
-		*buf = vmalloc(len);
+		*buf = vzalloc(len);
 		if (!(*buf))
 			return -ENOMEM;
 
-		memset(*buf, 0, len);
 		return 0;
 }
 
-- 
2.23.0


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

only message in thread, other threads:[~2020-09-16  6:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  6:21 [PATCH -next] scsi: qedf: use vzalloc() instead of vmalloc() and memset(0) Qinglang Miao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.