mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-18 07:35:12 +08:00
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 <rui.xiang@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3089a4c8d3
commit
40e2c71d57
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user