Skip to content

Commit

Permalink
[SCSI] lpfc: don't dereference NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and James Bottomley committed Aug 22, 2009
1 parent 0fd30f7 commit e34ccdf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e34ccdf

Please sign in to comment.