summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-07-13 23:25:54 +0200
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 17:51:55 -0500
commite34ccdfe0e08a6acb8c5e649fef1e94e6cd637f9 (patch)
tree037fc5ca114556aefc9734d6034ba3ad1dfbc162 /drivers/scsi/lpfc/lpfc_init.c
parent0fd30f77693f4fef32d30d4801cd21dcd487c2f0 (diff)
[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 <jirislaby@gmail.com> Acked-By: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c3
1 files changed, 1 insertions, 2 deletions
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;
}