From: Rui Xiang Date: Fri, 3 Jan 2014 03:10:36 +0000 (+1100) Subject: romfs: fix returm err while getting inode in fill_super X-Git-Tag: next-20140106~2^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6923cc28f689ad89b30cf5afb97c22fb3037d734;p=karo-tx-linux.git romfs: fix returm err while getting inode in fill_super 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 Signed-off-by: Andrew Morton --- diff --git a/fs/romfs/super.c b/fs/romfs/super.c index ff1d3d42e72a..d8418782862b 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -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: