Revert "lpfc: Delete unnecessary checks before the function call mempool_destroy"
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 10 May 2016 01:39:43 +0000 (21:39 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 11 May 2016 20:02:43 +0000 (13:02 -0700)
This reverts commit 9be321819c43417432a8376428b90fe3fe3a3510 which
caused a regression on hardware using the SLI3 interface.

Reported-by: Dick Kennedy <dick.kennedy@broadcom.com>
Cc: <stable@vger.kernel.org> # 4.6+
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <jejb@linux.vnet.ibm.com>
drivers/scsi/lpfc/lpfc_mem.c

index 4fb3581..3fa6533 100644 (file)
@@ -231,13 +231,15 @@ lpfc_mem_free(struct lpfc_hba *phba)
        if (phba->lpfc_hbq_pool)
                pci_pool_destroy(phba->lpfc_hbq_pool);
        phba->lpfc_hbq_pool = NULL;
-       mempool_destroy(phba->rrq_pool);
+
+       if (phba->rrq_pool)
+               mempool_destroy(phba->rrq_pool);
        phba->rrq_pool = NULL;
 
        /* Free NLP memory pool */
        mempool_destroy(phba->nlp_mem_pool);
        phba->nlp_mem_pool = NULL;
-       if (phba->sli_rev == LPFC_SLI_REV4) {
+       if (phba->sli_rev == LPFC_SLI_REV4 && phba->active_rrq_pool) {
                mempool_destroy(phba->active_rrq_pool);
                phba->active_rrq_pool = NULL;
        }