From: Chengguang Xu Date: Sun, 4 Nov 2018 13:57:49 +0000 (+0800) Subject: scsi: qla4xxx: remove unnecessary condition check for dma_pool_destroy() X-Git-Tag: v5.0-rc1~112^2~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08cf8ab3c9e6f392f8d051fa0b574bc173d96a5d;p=thirdparty%2Flinux.git scsi: qla4xxx: remove unnecessary condition check for dma_pool_destroy() 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 Acked-by: Manish Rangankar Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 051164f755a4c..039950ab1cbc1 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)) {