提交 e34ccdfe 编写于 作者: J Jiri Slaby 提交者: James Bottomley

[SCSI] lpfc: don't dereference NULL

When kzalloc fails in lpfc_hba_alloc, don't dereference the NULL by
lpfc_printf_log. Use dev_err instead.
Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
Acked-By: NJames Smart <james.smart@emulex.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 0fd30f77
......@@ -4130,8 +4130,7 @@ lpfc_hba_alloc(struct pci_dev *pdev)
/* Allocate memory for HBA structure */
phba = kzalloc(sizeof(struct lpfc_hba), GFP_KERNEL);
if (!phba) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"1417 Failed to allocate hba struct.\n");
dev_err(&pdev->dev, "failed to allocate hba struct\n");
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册