ext4: remove NULL check before calling kmem_cache_destroy()
authorSean Fu <fxinrong@gmail.com>
Mon, 21 May 2018 02:44:13 +0000 (22:44 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 21 May 2018 02:44:13 +0000 (22:44 -0400)
Signed-off-by: Sean Fu <fxinrong@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents_status.c
fs/ext4/mballoc.c

index 763ef185dd17f3ca1c2b97167ae620029de40186..c4e6fb15101b417f88d7bd45ef04aa55b829c3f4 100644 (file)
@@ -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)
index 0d473991eebd0123ff69c4c5ded34e4f6eda0ac5..243c42fdc155483922b60b95c69f2c79811bfd1a 100644 (file)
@@ -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;
        }
 }