ext2: remove redundant condition check
authorChengguang Xu <cgxu519@gmx.com>
Tue, 13 Nov 2018 23:23:53 +0000 (07:23 +0800)
committerJan Kara <jack@suse.cz>
Wed, 14 Nov 2018 12:14:56 +0000 (13:14 +0100)
ext2_xattr_destroy_cache() can handle NULL pointer correctly,
so there is no need to check NULL pointer before calling
ext2_xattr_destroy_cache().

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/super.c

index 5e2861b947a63a0008daa0685ce805058478e772..94cd10c463c233f98fcd1b4e416b93b424f13b4d 100644 (file)
@@ -148,10 +148,9 @@ static void ext2_put_super (struct super_block * sb)
 
        ext2_quota_off_umount(sb);
 
-       if (sbi->s_ea_block_cache) {
-               ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
-               sbi->s_ea_block_cache = NULL;
-       }
+       ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
+       sbi->s_ea_block_cache = NULL;
+
        if (!sb_rdonly(sb)) {
                struct ext2_super_block *es = sbi->s_es;
 
@@ -1197,8 +1196,7 @@ cantfind_ext2:
                        sb->s_id);
        goto failed_mount;
 failed_mount3:
-       if (sbi->s_ea_block_cache)
-               ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
+       ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
        percpu_counter_destroy(&sbi->s_freeblocks_counter);
        percpu_counter_destroy(&sbi->s_freeinodes_counter);
        percpu_counter_destroy(&sbi->s_dirs_counter);