]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: lpfc: Fix crash when a REG_RPI mailbox fails triggering a LOGO response
authorJames Smart <jsmart2021@gmail.com>
Mon, 12 Apr 2021 01:31:13 +0000 (18:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:39:52 +0000 (08:39 +0200)
[ Upstream commit fffd18ec6579c2d9c72b212169259062fe747888 ]

Fix a crash caused by a double put on the node when the driver completed an
ACC for an unsolicted abort on the same node.  The second put was executed
by lpfc_nlp_not_used() and is wrong because the completion routine executes
the nlp_put when the iocbq was released.  Additionally, the driver is
issuing a LOGO then immediately calls lpfc_nlp_set_state to put the node
into NPR.  This call does nothing.

Remove the lpfc_nlp_not_used call and additional set_state in the
completion routine.  Remove the lpfc_nlp_set_state post issue_logo.  Isn't
necessary.

Link: https://lore.kernel.org/r/20210412013127.2387-3-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/lpfc/lpfc_sli.c

index 7fc796905a7ab9b4cd2e32867dd7ee8acd98b257..9f05f5e329c6b2a037d7937a9a49016d9ebcf08d 100644 (file)
@@ -1891,8 +1891,6 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
                ndlp->nlp_last_elscmd = ELS_CMD_PLOGI;
 
                lpfc_issue_els_logo(vport, ndlp, 0);
-               ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
-               lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
                return ndlp->nlp_state;
        }
 
index 071a13d4d14ab9343dffebeb19e2bedf32342719..8e34d6076fbc80c04d3d979277075e4460c3ac50 100644 (file)
@@ -18074,7 +18074,6 @@ lpfc_sli4_seq_abort_rsp_cmpl(struct lpfc_hba *phba,
        if (cmd_iocbq) {
                ndlp = (struct lpfc_nodelist *)cmd_iocbq->context1;
                lpfc_nlp_put(ndlp);
-               lpfc_nlp_not_used(ndlp);
                lpfc_sli_release_iocbq(phba, cmd_iocbq);
        }