提交 2a38d2a8 编写于 作者: Y Yang Yingliang 提交者: Martin K. Petersen

scsi: qedf: Use vzalloc() instead of vmalloc()/memset(0)

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

Link: https://lore.kernel.org/r/20210518132018.1312995-1-yangyingliang@huawei.comReviewed-by: NHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 b592d662
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册