From: James Smart Date: Wed, 27 Apr 2022 22:21:58 +0000 (-0700) Subject: scsi: lpfc: Fix additional reference counting in lpfc_bsg_rport_els() X-Git-Tag: baikal/mips/sdk6.1~5690^2~63 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=b3345e1cd56a2a2c0715d26e66bfd45a943b9492;p=kernel.git 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 Signed-off-by: Nigel Kirkland Signed-off-by: James Smart Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index ae46383b13bf1..676e7d54b97a0 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -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);