Commit b4b22a01 authored by Souptick Joarder's avatar Souptick Joarder Committed by Martin K. Petersen

scsi: lpfc: Replace pci_pool_alloc by pci_pool_zalloc

In lpfc_new_scsi_buf_s3() and lpfc_new_scsi_buf_s4() pci_pool_alloc
followed by memset will be replaced by pci_pool_zalloc()
Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Acked-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b0120d99
...@@ -413,15 +413,13 @@ lpfc_new_scsi_buf_s3(struct lpfc_vport *vport, int num_to_alloc) ...@@ -413,15 +413,13 @@ lpfc_new_scsi_buf_s3(struct lpfc_vport *vport, int num_to_alloc)
* struct fcp_cmnd, struct fcp_rsp and the number of bde's * struct fcp_cmnd, struct fcp_rsp and the number of bde's
* necessary to support the sg_tablesize. * necessary to support the sg_tablesize.
*/ */
psb->data = pci_pool_alloc(phba->lpfc_scsi_dma_buf_pool, psb->data = pci_pool_zalloc(phba->lpfc_scsi_dma_buf_pool,
GFP_KERNEL, &psb->dma_handle); GFP_KERNEL, &psb->dma_handle);
if (!psb->data) { if (!psb->data) {
kfree(psb); kfree(psb);
break; break;
} }
/* Initialize virtual ptrs to dma_buf region. */
memset(psb->data, 0, phba->cfg_sg_dma_buf_size);
/* Allocate iotag for psb->cur_iocbq. */ /* Allocate iotag for psb->cur_iocbq. */
iotag = lpfc_sli_next_iotag(phba, &psb->cur_iocbq); iotag = lpfc_sli_next_iotag(phba, &psb->cur_iocbq);
...@@ -821,13 +819,12 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc) ...@@ -821,13 +819,12 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc)
* for the struct fcp_cmnd, struct fcp_rsp and the number * for the struct fcp_cmnd, struct fcp_rsp and the number
* of bde's necessary to support the sg_tablesize. * of bde's necessary to support the sg_tablesize.
*/ */
psb->data = pci_pool_alloc(phba->lpfc_scsi_dma_buf_pool, psb->data = pci_pool_zalloc(phba->lpfc_scsi_dma_buf_pool,
GFP_KERNEL, &psb->dma_handle); GFP_KERNEL, &psb->dma_handle);
if (!psb->data) { if (!psb->data) {
kfree(psb); kfree(psb);
break; break;
} }
memset(psb->data, 0, phba->cfg_sg_dma_buf_size);
/* /*
* 4K Page alignment is CRITICAL to BlockGuard, double check * 4K Page alignment is CRITICAL to BlockGuard, double check
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment