Commit dc264641 authored by Julia Lawall's avatar Julia Lawall Committed by Martin K. Petersen

scsi: lpfc: Use kcalloc()

Use kcalloc() instead of kmalloc() + memset().

Link: https://lore.kernel.org/r/20220313141847.109804-1-Julia.Lawall@inria.frSuggested-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9d05790f
......@@ -6272,9 +6272,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
phba->hba_debugfs_root,
phba, &lpfc_debugfs_op_slow_ring_trc);
if (!phba->slow_ring_trc) {
phba->slow_ring_trc = kmalloc(
(sizeof(struct lpfc_debugfs_trc) *
lpfc_debugfs_max_slow_ring_trc),
phba->slow_ring_trc = kcalloc(
lpfc_debugfs_max_slow_ring_trc,
sizeof(struct lpfc_debugfs_trc),
GFP_KERNEL);
if (!phba->slow_ring_trc) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
......@@ -6283,9 +6283,6 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
goto debug_failed;
}
atomic_set(&phba->slow_ring_trc_cnt, 0);
memset(phba->slow_ring_trc, 0,
(sizeof(struct lpfc_debugfs_trc) *
lpfc_debugfs_max_slow_ring_trc));
}
snprintf(name, sizeof(name), "nvmeio_trc");
......
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