scsi: lpfc: Fix additional reference counting in lpfc_bsg_rport_els()

Code inspection has found an additional reference is taken in
lpfc_bsg_rport_els(). Results in the ndlp not being freed thus is leaked.

Fix by removing the redundant refcount taken before WQE submission.

Link: https://lore.kernel.org/r/20220427222158.57867-1-jsmart2021@gmail.com
Co-developed-by: Nigel Kirkland <nigel.kirkland@broadcom.com>
Signed-off-by: Nigel Kirkland <nigel.kirkland@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
James Smart 2022-04-27 15:21:58 -07:00 committed by Martin K. Petersen
parent 1e029397d1
commit 92bd903da1

View File

@ -740,12 +740,6 @@ lpfc_bsg_rport_els(struct bsg_job *job)
readl(phba->HCregaddr); /* flush */
}
cmdiocbq->ndlp = lpfc_nlp_get(ndlp);
if (!cmdiocbq->ndlp) {
rc = -EIO;
goto linkdown_err;
}
rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, cmdiocbq, 0);
if (rc == IOCB_SUCCESS) {
spin_lock_irqsave(&phba->hbalock, flags);