[SCSI] lpfc 8.3.30: Fix resource leak when acc fails for received plogi
authorJames Smart <james.smart@emulex.com>
Fri, 2 Mar 2012 03:36:15 +0000 (22:36 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 27 Mar 2012 07:26:31 +0000 (08:26 +0100)
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_nportdisc.c

index 7b6b2aa..cc5dcd9 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;