Skip to content

Commit

Permalink
lpfc: Delete unnecessary checks before the function call "mempool_des…
Browse files Browse the repository at this point in the history
…troy"

The mempool_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Markus Elfring authored and Martin K. Petersen committed Dec 22, 2015
1 parent 448193b commit 9be3218
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/scsi/lpfc/lpfc_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,13 @@ lpfc_mem_free(struct lpfc_hba *phba)
if (phba->lpfc_hbq_pool)
pci_pool_destroy(phba->lpfc_hbq_pool);
phba->lpfc_hbq_pool = NULL;

if (phba->rrq_pool)
mempool_destroy(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 && phba->active_rrq_pool) {
if (phba->sli_rev == LPFC_SLI_REV4) {
mempool_destroy(phba->active_rrq_pool);
phba->active_rrq_pool = NULL;
}
Expand Down

0 comments on commit 9be3218

Please sign in to comment.