summaryrefslogtreecommitdiff
path: root/drivers/scsi/aic94xx
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-07-11 17:15:39 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2019-07-30 19:12:59 +0300
commitb217598890a26fe49c83f4f3124c343a6d990eb2 (patch)
treea621cc94a83b7d9feb7d8a2f39f6b965273b4c16 /drivers/scsi/aic94xx
parent0b3b6fe299c471e44ed8713b7a602882626e693f (diff)
downloadlinux-b217598890a26fe49c83f4f3124c343a6d990eb2.tar.xz
scsi: aic94xx: Remove unnecessary null check
kmem_cache_destroy() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling kmem_cache_destroy(). Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aic94xx')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 261d8e495fed..f5781e31f57c 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -565,8 +565,7 @@ static void asd_destroy_ha_caches(struct asd_ha_struct *asd_ha)
if (asd_ha->hw_prof.scb_ext)
asd_free_coherent(asd_ha, asd_ha->hw_prof.scb_ext);
- if (asd_ha->hw_prof.ddb_bitmap)
- kfree(asd_ha->hw_prof.ddb_bitmap);
+ kfree(asd_ha->hw_prof.ddb_bitmap);
asd_ha->hw_prof.ddb_bitmap = NULL;
for (i = 0; i < ASD_MAX_PHYS; i++) {
@@ -641,12 +640,10 @@ Err:
static void asd_destroy_global_caches(void)
{
- if (asd_dma_token_cache)
- kmem_cache_destroy(asd_dma_token_cache);
+ kmem_cache_destroy(asd_dma_token_cache);
asd_dma_token_cache = NULL;
- if (asd_ascb_cache)
- kmem_cache_destroy(asd_ascb_cache);
+ kmem_cache_destroy(asd_ascb_cache);
asd_ascb_cache = NULL;
}