Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "lpfc: Delete unnecessary checks before the function call mempool_destroy"

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>

authored by

Martin K. Petersen and committed by
James Bottomley
d65c8fff 2bcbc814

+4 -2
+4 -2
drivers/scsi/lpfc/lpfc_mem.c
··· 231 231 if (phba->lpfc_hbq_pool) 232 232 pci_pool_destroy(phba->lpfc_hbq_pool); 233 233 phba->lpfc_hbq_pool = NULL; 234 - mempool_destroy(phba->rrq_pool); 234 + 235 + if (phba->rrq_pool) 236 + mempool_destroy(phba->rrq_pool); 235 237 phba->rrq_pool = NULL; 236 238 237 239 /* Free NLP memory pool */ 238 240 mempool_destroy(phba->nlp_mem_pool); 239 241 phba->nlp_mem_pool = NULL; 240 - if (phba->sli_rev == LPFC_SLI_REV4) { 242 + if (phba->sli_rev == LPFC_SLI_REV4 && phba->active_rrq_pool) { 241 243 mempool_destroy(phba->active_rrq_pool); 242 244 phba->active_rrq_pool = NULL; 243 245 }