add patch forbid-overflowing-inode-code-when-resizing
[ext4-patch-queue.git] / ext4-remove-NULL-check-before-calling-kmem-cache-destroy
blobdbbded79c64ceec9803c5de3f321b4b5ffe1fd02
1 ext4: remove NULL check before calling kmem_cache_destroy()
3 From: Sean Fu <fxinrong@gmail.com>
5 Signed-off-by: Sean Fu <fxinrong@gmail.com>
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 ---
8  fs/ext4/extents_status.c | 3 +--
9  fs/ext4/mballoc.c        | 3 +--
10  2 files changed, 2 insertions(+), 4 deletions(-)
12 diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
13 index 763ef18..c4e6fb1 100644
14 --- a/fs/ext4/extents_status.c
15 +++ b/fs/ext4/extents_status.c
16 @@ -162,8 +162,7 @@ int __init ext4_init_es(void)
18  void ext4_exit_es(void)
19  {
20 -       if (ext4_es_cachep)
21 -               kmem_cache_destroy(ext4_es_cachep);
22 +       kmem_cache_destroy(ext4_es_cachep);
23  }
25  void ext4_es_init_tree(struct ext4_es_tree *tree)
26 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
27 index d9f8b90a..4fd1349 100644
28 --- a/fs/ext4/mballoc.c
29 +++ b/fs/ext4/mballoc.c
30 @@ -2549,8 +2549,7 @@ static void ext4_groupinfo_destroy_slabs(void)
31         int i;
33         for (i = 0; i < NR_GRPINFO_CACHES; i++) {
34 -               if (ext4_groupinfo_caches[i])
35 -                       kmem_cache_destroy(ext4_groupinfo_caches[i]);
36 +               kmem_cache_destroy(ext4_groupinfo_caches[i]);
37                 ext4_groupinfo_caches[i] = NULL;
38         }
39  }
40 -- 
41 2.6.2