scsi: qedf: Use vzalloc() instead of vmalloc()/memset(0)
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 18 May 2021 13:20:18 +0000 (21:20 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 May 2021 20:31:17 +0000 (16:31 -0400)
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>
drivers/scsi/qedf/qedf_dbg.c

index e0387e4..0d2aed8 100644 (file)
@@ -106,11 +106,10 @@ ret:
 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;
 }