瀏覽代碼

ext4: remove NULL check before calling kmem_cache_destroy()

Signed-off-by: Sean Fu <fxinrong@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Sean Fu 7 年之前
父節點
當前提交
21c580d88e
共有 2 個文件被更改,包括 2 次插入4 次删除
  1. 1 2
      fs/ext4/extents_status.c
  2. 1 2
      fs/ext4/mballoc.c

+ 1 - 2
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)

+ 1 - 2
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;
 	}
 }