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 <[email protected]>
---
 drivers/scsi/qla4xxx/ql4_os.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 051164f755a4..039950ab1cbc 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4165,15 +4165,13 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
 
        ha->srb_mempool = NULL;
 
-       if (ha->chap_dma_pool)
-               dma_pool_destroy(ha->chap_dma_pool);
+       dma_pool_destroy(ha->chap_dma_pool);
 
        if (ha->chap_list)
                vfree(ha->chap_list);
        ha->chap_list = NULL;
 
-       if (ha->fw_ddb_dma_pool)
-               dma_pool_destroy(ha->fw_ddb_dma_pool);
+       dma_pool_destroy(ha->fw_ddb_dma_pool);
 
        /* release io space registers  */
        if (is_qla8022(ha)) {
-- 
2.17.2

Reply via email to