From: Sean Fu Date: Mon, 21 May 2018 02:44:13 +0000 (-0400) Subject: ext4: remove NULL check before calling kmem_cache_destroy() X-Git-Tag: v4.18-rc1~143^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21c580d88e2abd62b58ce34872cceb5c0d056330;p=thirdparty%2Flinux.git ext4: remove NULL check before calling kmem_cache_destroy() Signed-off-by: Sean Fu Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index 763ef185dd17f..c4e6fb15101b4 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c @@ -162,8 +162,7 @@ int __init ext4_init_es(void) void ext4_exit_es(void) { - if (ext4_es_cachep) - kmem_cache_destroy(ext4_es_cachep); + kmem_cache_destroy(ext4_es_cachep); } void ext4_es_init_tree(struct ext4_es_tree *tree) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 0d473991eebd0..243c42fdc1554 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2537,8 +2537,7 @@ static void ext4_groupinfo_destroy_slabs(void) int i; for (i = 0; i < NR_GRPINFO_CACHES; i++) { - if (ext4_groupinfo_caches[i]) - kmem_cache_destroy(ext4_groupinfo_caches[i]); + kmem_cache_destroy(ext4_groupinfo_caches[i]); ext4_groupinfo_caches[i] = NULL; } }