Skip to content

Commit 931d553

Browse files
Quinn Trangregkh
authored andcommitted
scsi: qla2xxx: Fix crash on session cleanup with unload
commit 50457da upstream. On unload, session cleanup prematurely gave the signal for driver unload path to advance. Link: https://lore.kernel.org/r/20200929102152.32278-6-njavali@marvell.com Fixes: 726b854 ("qla2xxx: Add framework for async fabric discovery") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f4f250c commit 931d553

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,14 +1229,15 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)
12291229
case DSC_DELETE_PEND:
12301230
return;
12311231
case DSC_DELETED:
1232-
if (tgt && tgt->tgt_stop && (tgt->sess_count == 0))
1233-
wake_up_all(&tgt->waitQ);
1234-
if (sess->vha->fcport_count == 0)
1235-
wake_up_all(&sess->vha->fcport_waitQ);
1236-
12371232
if (!sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN] &&
1238-
!sess->plogi_link[QLT_PLOGI_LINK_CONFLICT])
1233+
!sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]) {
1234+
if (tgt && tgt->tgt_stop && tgt->sess_count == 0)
1235+
wake_up_all(&tgt->waitQ);
1236+
1237+
if (sess->vha->fcport_count == 0)
1238+
wake_up_all(&sess->vha->fcport_waitQ);
12391239
return;
1240+
}
12401241
break;
12411242
case DSC_UPD_FCPORT:
12421243
/*

0 commit comments

Comments
 (0)