Dereference in drivers/scsi/lpfc/lpfc_ct.c
Subsystems (2)
PATCH 27/36 Dereference in drivers/scsi/lpfc/lpfc_ct.c
From: Eric Sesterhenn <[email protected]>
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]>
---
drivers/scsi/lpfc/lpfc_ct.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_ct.c renamed from drivers/scsi/lpfc/lpfc_ct.c~dereference-in-drivers-scsi-lpfc-lpfc_ctc +2 -1
@@ -188,7 +188,8 @@ lpfc_alloc_ct_rsp(struct lpfc_hba * phbaif (!mp->virt) {kfree (mp); -lpfc_free_ct_rsp (phba, mlist); +if (mlist) +lpfc_free_ct_rsp (phba, mlist);return NULL ; }
_