public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: lpfc, don't dereference NULL
@ 2009-07-13 21:25 Jiri Slaby
  2009-07-15 19:00 ` James Smart
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2009-07-13 21:25 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, james.smart, linux-kernel, Jiri Slaby

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>
---
 drivers/scsi/lpfc/lpfc_init.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index fc67cc6..2452dc9 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;
 	}
 
-- 
1.6.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] SCSI: lpfc, don't dereference NULL
  2009-07-13 21:25 [PATCH] SCSI: lpfc, don't dereference NULL Jiri Slaby
@ 2009-07-15 19:00 ` James Smart
  0 siblings, 0 replies; 2+ messages in thread
From: James Smart @ 2009-07-15 19:00 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org

Thanks Jiri.

-- james s


Acked-By:  James Smart  <james.smart@emulex.com>


Jiri Slaby wrote:
> 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>
> ---
>  drivers/scsi/lpfc/lpfc_init.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index fc67cc6..2452dc9 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;
>  	}
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-15 19:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 21:25 [PATCH] SCSI: lpfc, don't dereference NULL Jiri Slaby
2009-07-15 19:00 ` James Smart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox