scsi: snic: Use vzalloc
authorSabyasachi Gupta <sabyasachi.linux@gmail.com>
Thu, 15 Nov 2018 16:34:04 +0000 (22:04 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 8 Dec 2018 02:30:32 +0000 (21:30 -0500)
Replaced vmalloc + memset with vzalloc

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Acked-by: Sesidhar Baddela <sebaddel@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/snic/snic_trc.c

index fc60c93..458eaba 100644 (file)
@@ -126,7 +126,7 @@ snic_trc_init(void)
        int tbuf_sz = 0, ret;
 
        tbuf_sz = (snic_trace_max_pages * PAGE_SIZE);
-       tbuf = vmalloc(tbuf_sz);
+       tbuf = vzalloc(tbuf_sz);
        if (!tbuf) {
                SNIC_ERR("Failed to Allocate Trace Buffer Size. %d\n", tbuf_sz);
                SNIC_ERR("Trace Facility not enabled.\n");
@@ -135,7 +135,6 @@ snic_trc_init(void)
                return ret;
        }
 
-       memset(tbuf, 0, tbuf_sz);
        trc->buf = (struct snic_trc_data *) tbuf;
        spin_lock_init(&trc->lock);