Skip to content

Commit

Permalink
[SCSI] lpfc: check before dereference in lpfc_ct.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: James Smart <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
SesterhennEric authored and James Bottomley committed Oct 25, 2006
1 parent 46c43db commit 0b3a82d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/lpfc/lpfc_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ lpfc_alloc_ct_rsp(struct lpfc_hba * phba, int cmdcode, struct ulp_bde64 * bpl,

if (!mp->virt) {
kfree(mp);
lpfc_free_ct_rsp(phba, mlist);
if (mlist)
lpfc_free_ct_rsp(phba, mlist);
return NULL;
}

Expand Down

0 comments on commit 0b3a82d

Please sign in to comment.