From: Jiri Slaby Date: Mon, 13 Jul 2009 21:25:54 +0000 (+0200) Subject: [SCSI] lpfc: don't dereference NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e34ccdfe0e08a6acb8c5e649fef1e94e6cd637f9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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: Jiri Slaby Acked-By: James Smart Signed-off-by: James Bottomley Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index fc67cc65c63b..2452dc9c9014 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -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; }