]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fix resource leak when acc fails for received plogi (CR 127847)
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 8 May 2012 22:01:27 +0000 (17:01 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:01:27 +0000 (17:01 -0700)
When a port tries to respond to a plogi that it receives and the issue of the
acc fails the mailbox command that was allocated to register the RPI is not
freed. Now, if the issue for the acc or reject fails free the mailbox command
that was allocated to register the RPI.

commit id: 0a8a86facf359147b2d3ef796496a09b21984b03

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
drivers/scsi/lpfc/lpfc_nportdisc.c

index 7b6b2aa5795aba306e54830c0224a5fd3c8048be..cc5dcd9e7d242b141695504fdfd2fe4938ab3895 100644 (file)
@@ -440,11 +440,15 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
                spin_unlock_irq(shost->host_lock);
                stat.un.b.lsRjtRsnCode = LSRJT_INVALID_CMD;
                stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE;
-               lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb,
+               rc = lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb,
                        ndlp, mbox);
+               if (rc)
+                       mempool_free(mbox, phba->mbox_mem_pool);
                return 1;
        }
-       lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox);
+       rc = lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox);
+       if (rc)
+               mempool_free(mbox, phba->mbox_mem_pool);
        return 1;
 out:
        stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;