diff options
author | Sean Fu <fxinrong@gmail.com> | 2018-05-20 22:44:13 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-05-20 22:44:13 -0400 |
commit | 21c580d88e2abd62b58ce34872cceb5c0d056330 (patch) | |
tree | 260952e63ede44a7571f1c36ca020de51a0e2e94 | |
parent | 8bdd5b60e0273e6682d5c269c70e6287ae60eb55 (diff) |
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>
-rw-r--r-- | fs/ext4/extents_status.c | 3 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index 763ef185dd17..c4e6fb15101b 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c | |||
@@ -162,8 +162,7 @@ int __init ext4_init_es(void) | |||
162 | 162 | ||
163 | void ext4_exit_es(void) | 163 | void ext4_exit_es(void) |
164 | { | 164 | { |
165 | if (ext4_es_cachep) | 165 | kmem_cache_destroy(ext4_es_cachep); |
166 | kmem_cache_destroy(ext4_es_cachep); | ||
167 | } | 166 | } |
168 | 167 | ||
169 | void ext4_es_init_tree(struct ext4_es_tree *tree) | 168 | void ext4_es_init_tree(struct ext4_es_tree *tree) |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 0d473991eebd..243c42fdc155 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -2537,8 +2537,7 @@ static void ext4_groupinfo_destroy_slabs(void) | |||
2537 | int i; | 2537 | int i; |
2538 | 2538 | ||
2539 | for (i = 0; i < NR_GRPINFO_CACHES; i++) { | 2539 | for (i = 0; i < NR_GRPINFO_CACHES; i++) { |
2540 | if (ext4_groupinfo_caches[i]) | 2540 | kmem_cache_destroy(ext4_groupinfo_caches[i]); |
2541 | kmem_cache_destroy(ext4_groupinfo_caches[i]); | ||
2542 | ext4_groupinfo_caches[i] = NULL; | 2541 | ext4_groupinfo_caches[i] = NULL; |
2543 | } | 2542 | } |
2544 | } | 2543 | } |