lkml.org 
[lkml]   [2020]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] scsi: qedf: use vzalloc() instead of vmalloc() and memset(0)
Date
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
\
 
 \ /
  Last update: 2020-09-16 08:22    [W:0.029 / U:3.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site