diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2019-05-29 22:21:36 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-06-19 01:46:23 +0200 |
commit | a5c990eea5ddd587bcd9af6dc973a1653c8d94af (patch) | |
tree | 9ac44bd853e04e60a100566caf528429ff95fdcf /drivers | |
parent | scsi: hpsa: fix an uninitialized read and dereference of pointer dev (diff) | |
download | linux-a5c990eea5ddd587bcd9af6dc973a1653c8d94af.tar.xz linux-a5c990eea5ddd587bcd9af6dc973a1653c8d94af.zip |
scsi: lpfc: Use *_pool_zalloc rather than *_pool_alloc
Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a2b827dd36ff..1a8abb4b0974 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -4116,14 +4116,13 @@ lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc) * pci bus space for an I/O. The DMA buffer includes the * number of SGE's necessary to support the sg_tablesize. */ - lpfc_ncmd->data = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool, - GFP_KERNEL, - &lpfc_ncmd->dma_handle); + lpfc_ncmd->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool, + GFP_KERNEL, + &lpfc_ncmd->dma_handle); if (!lpfc_ncmd->data) { kfree(lpfc_ncmd); break; } - memset(lpfc_ncmd->data, 0, phba->cfg_sg_dma_buf_size); /* * 4K Page alignment is CRITICAL to BlockGuard, double check |