dma_pool_destroy() can handle NULL pointer correctly, so there is
no need to check NULL pointer before calling dma_pool_destroy().

Signed-off-by: Chengguang Xu <cgxu...@gmx.com>
---
 drivers/scsi/megaraid/megaraid_mbox.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_mbox.c 
b/drivers/scsi/megaraid/megaraid_mbox.c
index 3b7abe5ca7f5..7f9ba88d1c2d 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -1243,8 +1243,7 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
                dma_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr,
                        sg_pci_blk[i].dma_addr);
        }
-       if (raid_dev->sg_pool_handle)
-               dma_pool_destroy(raid_dev->sg_pool_handle);
+       dma_pool_destroy(raid_dev->sg_pool_handle);
 
 
        epthru_pci_blk = raid_dev->epthru_pool;
@@ -1252,8 +1251,7 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
                dma_pool_free(raid_dev->epthru_pool_handle,
                        epthru_pci_blk[i].vaddr, epthru_pci_blk[i].dma_addr);
        }
-       if (raid_dev->epthru_pool_handle)
-               dma_pool_destroy(raid_dev->epthru_pool_handle);
+       dma_pool_destroy(raid_dev->epthru_pool_handle);
 
 
        mbox_pci_blk = raid_dev->mbox_pool;
@@ -1261,8 +1259,7 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
                dma_pool_free(raid_dev->mbox_pool_handle,
                        mbox_pci_blk[i].vaddr, mbox_pci_blk[i].dma_addr);
        }
-       if (raid_dev->mbox_pool_handle)
-               dma_pool_destroy(raid_dev->mbox_pool_handle);
+       dma_pool_destroy(raid_dev->mbox_pool_handle);
 
        return;
 }
-- 
2.17.2

Reply via email to