public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 27/36] Dereference in drivers/scsi/lpfc/lpfc_ct.c
@ 2006-10-10 21:41 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2006-10-10 21:41 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, snakebyte, James.Smart

From: Eric Sesterhenn <snakebyte@gmx.de>

If we fail to allocate mp->virt during the first while loop iteration,
mlist is still uninitialized, therefore we should check if before
dereferencing.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/scsi/lpfc/lpfc_ct.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/lpfc/lpfc_ct.c~dereference-in-drivers-scsi-lpfc-lpfc_ctc drivers/scsi/lpfc/lpfc_ct.c
--- a/drivers/scsi/lpfc/lpfc_ct.c~dereference-in-drivers-scsi-lpfc-lpfc_ctc
+++ a/drivers/scsi/lpfc/lpfc_ct.c
@@ -188,7 +188,8 @@ lpfc_alloc_ct_rsp(struct lpfc_hba * phba
 
 		if (!mp->virt) {
 			kfree(mp);
-			lpfc_free_ct_rsp(phba, mlist);
+			if (mlist)
+				lpfc_free_ct_rsp(phba, mlist);
 			return NULL;
 		}
 
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-10 21:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 21:41 [patch 27/36] Dereference in drivers/scsi/lpfc/lpfc_ct.c akpm

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