mirror of https://gitee.com/openkylin/linux.git
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.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
b592d66235
commit
2a38d2a8b4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue