scsi: lpfc: Drop nodelist reference on error in lpfc_gen_req()
authorHannes Reinecke <hare@suse.de>
Thu, 10 Sep 2020 08:40:59 +0000 (10:40 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 3 Oct 2020 01:38:57 +0000 (21:38 -0400)
If we fail to issue the iocb in lpfc_gen_req() we need to drop the nodelist
reference.

Link: https://lore.kernel.org/r/20200910084059.138507-1-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_ct.c

index ef2015fad2d5929da4cf5d0cab05bcf8d00d9356..c201686d381553c48cc4c4acd4a38e4376166a07 100644 (file)
@@ -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;
        }