|
@@ -5848,16 +5848,14 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba)
|
|
|
if (!dmabuf)
|
|
|
return NULL;
|
|
|
|
|
|
- dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
|
|
|
- LPFC_HDR_TEMPLATE_SIZE,
|
|
|
- &dmabuf->phys,
|
|
|
- GFP_KERNEL);
|
|
|
+ dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
|
|
|
+ LPFC_HDR_TEMPLATE_SIZE,
|
|
|
+ &dmabuf->phys, GFP_KERNEL);
|
|
|
if (!dmabuf->virt) {
|
|
|
rpi_hdr = NULL;
|
|
|
goto err_free_dmabuf;
|
|
|
}
|
|
|
|
|
|
- memset(dmabuf->virt, 0, LPFC_HDR_TEMPLATE_SIZE);
|
|
|
if (!IS_ALIGNED(dmabuf->phys, LPFC_HDR_TEMPLATE_SIZE)) {
|
|
|
rpi_hdr = NULL;
|
|
|
goto err_free_coherent;
|
|
@@ -6246,14 +6244,11 @@ lpfc_sli_pci_mem_setup(struct lpfc_hba *phba)
|
|
|
}
|
|
|
|
|
|
/* Allocate memory for SLI-2 structures */
|
|
|
- phba->slim2p.virt = dma_alloc_coherent(&pdev->dev,
|
|
|
- SLI2_SLIM_SIZE,
|
|
|
- &phba->slim2p.phys,
|
|
|
- GFP_KERNEL);
|
|
|
+ phba->slim2p.virt = dma_zalloc_coherent(&pdev->dev, SLI2_SLIM_SIZE,
|
|
|
+ &phba->slim2p.phys, GFP_KERNEL);
|
|
|
if (!phba->slim2p.virt)
|
|
|
goto out_iounmap;
|
|
|
|
|
|
- memset(phba->slim2p.virt, 0, SLI2_SLIM_SIZE);
|
|
|
phba->mbox = phba->slim2p.virt + offsetof(struct lpfc_sli2_slim, mbx);
|
|
|
phba->mbox_ext = (phba->slim2p.virt +
|
|
|
offsetof(struct lpfc_sli2_slim, mbx_ext_words));
|
|
@@ -6618,15 +6613,12 @@ lpfc_create_bootstrap_mbox(struct lpfc_hba *phba)
|
|
|
* plus an alignment restriction of 16 bytes.
|
|
|
*/
|
|
|
bmbx_size = sizeof(struct lpfc_bmbx_create) + (LPFC_ALIGN_16_BYTE - 1);
|
|
|
- dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
|
|
|
- bmbx_size,
|
|
|
- &dmabuf->phys,
|
|
|
- GFP_KERNEL);
|
|
|
+ dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev, bmbx_size,
|
|
|
+ &dmabuf->phys, GFP_KERNEL);
|
|
|
if (!dmabuf->virt) {
|
|
|
kfree(dmabuf);
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
- memset(dmabuf->virt, 0, bmbx_size);
|
|
|
|
|
|
/*
|
|
|
* Initialize the bootstrap mailbox pointers now so that the register
|