f2fs: fix error path of fill_super
authorChao Yu <yuchao0@huawei.com>
Mon, 11 Jun 2018 10:02:02 +0000 (18:02 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Sep 2018 22:07:35 +0000 (15:07 -0700)
In fill_super, if root inode's attribute is incorrect, we need to
call f2fs_destroy_stats to release stats memory.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 6bf2cdc30e1720f6e07989d31bc9e3bf59fbb38c..520b76a353ab8055b020f8c15964e5c420e6a00f 100644 (file)
@@ -2911,7 +2911,7 @@ try_onemore:
        if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) {
                iput(root);
                err = -EINVAL;
-               goto free_node_inode;
+               goto free_stats;
        }
 
        sb->s_root = d_make_root(root); /* allocate root dentry */