Message ID | 20180827234620.13836-1-cgxu519@gmx.com (mailing list archive) |
---|---|
State | Deferred |
Headers | show |
Series | aic94xx: remove unnecessary condition check | expand |
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 1391e5f35918..06a2642b977a 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c @@ -660,12 +660,10 @@ static int asd_create_global_caches(void) 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; }
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: Chengguang Xu <cgxu519@gmx.com> --- drivers/scsi/aic94xx/aic94xx_init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)