diff mbox series

lpfc: drop nodelist reference on error in lpfc_gen_req()

Message ID 20200910084059.138507-1-hare@suse.de (mailing list archive)
State Accepted
Headers show
Series lpfc: drop nodelist reference on error in lpfc_gen_req() | expand

Commit Message

Hannes Reinecke Sept. 10, 2020, 8:40 a.m. UTC
If we fail to issue the iocb in lpfc_gen_req() we need to drop
the nodelist reference.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/lpfc/lpfc_ct.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Martin K. Petersen Oct. 3, 2020, 1:39 a.m. UTC | #1
Hannes,

> If we fail to issue the iocb in lpfc_gen_req() we need to drop the
> nodelist reference.

Applied to 5.10/scsi-staging, thanks!
Martin K. Petersen Oct. 7, 2020, 3:47 a.m. UTC | #2
On Thu, 10 Sep 2020 10:40:59 +0200, Hannes Reinecke wrote:

> If we fail to issue the iocb in lpfc_gen_req() we need to drop
> the nodelist reference.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: lpfc: Drop nodelist reference on error in lpfc_gen_req()
      https://git.kernel.org/mkp/scsi/c/962d359c4d3b
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index ef2015fad2d5..c201686d3815 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -387,6 +387,8 @@  lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp,
 	rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, geniocb, 0);
 
 	if (rc == IOCB_ERROR) {
+		geniocb->context_un.ndlp = NULL;
+		lpfc_nlp_put(ndlp);
 		lpfc_sli_release_iocbq(phba, geniocb);
 		return 1;
 	}