From: James Smart Date: Tue, 21 Nov 2017 00:00:37 +0000 (-0800) Subject: scsi: lpfc: Fix ndlp ref count for pt2pt mode issue RSCN X-Git-Tag: v4.1.12-124.31.3~991 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0ea2edbaf2aade06684c6a05cd15342ffd818e5d;p=users%2Fjedix%2Flinux-maple.git scsi: lpfc: Fix ndlp ref count for pt2pt mode issue RSCN Orabug: 27631736 pt2pt ndlp ref count prematurely goes to 0. There was reference removed that should only be removed if connected to a switch, not if in point-to-point mode. Add a mode check before the reference remove. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen (cherry picked from commit b7e50c536e8e4c6d4c74a1d54a0ce33edbf9dd0a) Signed-off-by: Dick dkennedy Signed-off-by: Dan Duval Reviewed-by: Jack Vogel --- diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 064925b918df..465a7a592344 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2804,8 +2804,8 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) /* This will cause the callback-function lpfc_cmpl_els_cmd to * trigger the release of node. */ - - lpfc_nlp_put(ndlp); + if (!(vport->fc_flag & FC_PT2PT)) + lpfc_nlp_put(ndlp); return 0; }