scsi: qla4xxx: remove unnecessary condition check for dma_pool_destroy()
authorChengguang Xu <cgxu519@gmx.com>
Sun, 4 Nov 2018 13:57:49 +0000 (21:57 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Nov 2018 02:19:37 +0000 (21:19 -0500)
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 <cgxu519@gmx.com>
Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla4xxx/ql4_os.c

index 051164f755a4c067ad30b27256fc354e0515d28f..039950ab1cbc15f88ef76b53f6d2f830a01b3fe7 100644 (file)
@@ -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)) {