Skip to content

Commit

Permalink
scsi: qla2xxx: Fix crash on session cleanup with unload
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Quinn Tran authored and gregkh committed Nov 5, 2020
1 parent f0ef0e2 commit a0bdb5b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/scsi/qla2xxx/qla_target.c
Expand Up @@ -1230,14 +1230,15 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)
case DSC_DELETE_PEND:
return;
case DSC_DELETED:
if (tgt && tgt->tgt_stop && (tgt->sess_count == 0))
wake_up_all(&tgt->waitQ);
if (sess->vha->fcport_count == 0)
wake_up_all(&sess->vha->fcport_waitQ);

if (!sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN] &&
!sess->plogi_link[QLT_PLOGI_LINK_CONFLICT])
!sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]) {
if (tgt && tgt->tgt_stop && tgt->sess_count == 0)
wake_up_all(&tgt->waitQ);

if (sess->vha->fcport_count == 0)
wake_up_all(&sess->vha->fcport_waitQ);
return;
}
break;
case DSC_UPD_FCPORT:
/*
Expand Down

0 comments on commit a0bdb5b

Please sign in to comment.