Unverified Commit d54ba3f5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15586 scsi: lpfc: Fix null pointer dereference after failing to issue FLOGI and PLOGI

parents 64f60cf1 c0abf1a0
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1408,9 +1408,11 @@ lpfc_initial_flogi(struct lpfc_vport *vport)
	}

	if (lpfc_issue_els_flogi(vport, ndlp, 0)) {
		/* This decrement of reference count to node shall kick off
		 * the release of the node.
		/* A node reference should be retained while registered with a
		 * transport or dev-loss-evt work is pending.
		 * Otherwise, decrement node reference to trigger release.
		 */
		if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS))
			lpfc_nlp_put(ndlp);
		return 0;
	}
@@ -1455,9 +1457,11 @@ lpfc_initial_fdisc(struct lpfc_vport *vport)
	}

	if (lpfc_issue_els_fdisc(vport, ndlp, 0)) {
		/* decrement node reference count to trigger the release of
		 * the node.
		/* A node reference should be retained while registered with a
		 * transport or dev-loss-evt work is pending.
		 * Otherwise, decrement node reference to trigger release.
		 */
		if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS))
			lpfc_nlp_put(ndlp);
		return 0;
	}