[SCSI] lpfc: check before dereference in lpfc_ct.c
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> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
46c43db1ea
commit
0b3a82d391
|
@ -188,6 +188,7 @@ lpfc_alloc_ct_rsp(struct lpfc_hba * phba, int cmdcode, struct ulp_bde64 * bpl,
|
||||||
|
|
||||||
if (!mp->virt) {
|
if (!mp->virt) {
|
||||||
kfree(mp);
|
kfree(mp);
|
||||||
|
if (mlist)
|
||||||
lpfc_free_ct_rsp(phba, mlist);
|
lpfc_free_ct_rsp(phba, mlist);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue