romfs: fix returm err while getting inode in fill_super
authorRui Xiang <rui.xiang@huawei.com>
Thu, 23 Jan 2014 23:56:19 +0000 (15:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:37:04 +0000 (16:37 -0800)
Getting an inode by romfs_iget may lead to an err in fill_super, and the
err value should be return.

And it should return -ENOMEM instead while d_make_root fails, fix it too.

Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/romfs/super.c

index ff1d3d42e72accd5a0572686d2c5f226ed59c5c3..d8418782862b60fe2b96b4bd131281417c2adc24 100644 (file)
@@ -533,16 +533,14 @@ static int romfs_fill_super(struct super_block *sb, void *data, int silent)
 
        root = romfs_iget(sb, pos);
        if (IS_ERR(root))
-               goto error;
+               return PTR_ERR(root);
 
        sb->s_root = d_make_root(root);
        if (!sb->s_root)
-               goto error;
+               return -ENOMEM;
 
        return 0;
 
-error:
-       return -EINVAL;
 error_rsb_inval:
        ret = -EINVAL;
 error_rsb: