Skip to content

Commit

Permalink
scsi: qla2xxx: Use dma_pool_zalloc()
Browse files Browse the repository at this point in the history
Use dma_pool_zalloc() instead of dma_pool_alloc() and memset().

Link: https://lore.kernel.org/r/1615603275-14303-1-git-send-email-wangqing@vivo.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Wang Qing authored and Martin K. Petersen committed Mar 16, 2021
1 parent 475bff6 commit 720efdd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -4238,11 +4238,10 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,

/* Get consistent memory allocated for Special Features-CB. */
if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
ha->sf_init_cb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL,
ha->sf_init_cb = dma_pool_zalloc(ha->s_dma_pool, GFP_KERNEL,
&ha->sf_init_cb_dma);
if (!ha->sf_init_cb)
goto fail_sf_init_cb;
memset(ha->sf_init_cb, 0, sizeof(struct init_sf_cb));
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0199,
"sf_init_cb=%p.\n", ha->sf_init_cb);
}
Expand Down

0 comments on commit 720efdd

Please sign in to comment.