Skip to contentSkip to conversation

scsi: qedf: Replace vmalloc + memset with vzalloc

PATCH New Chuhong Yuan 1 participant 1 message Jul 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 scsi: qedf: Replace vmalloc + memset with vzalloc

Use vzalloc instead of using vmalloc to allocate memory and then zeroing it with memset 0.
This simplifies the code.

---
 drivers/scsi/qedf/qedf_dbg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/qedf/qedf_dbg.c +1 -2
index e0387e495261..0d2aed82882a 100644
@@ -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;
 }
 
Signature · 1 line
2.20.1