Skip to content

Commit 40e2c71

Browse files
Rui Xiangtorvalds
authored andcommitted
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>
1 parent 3089a4c commit 40e2c71

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎fs/romfs/super.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,16 +533,14 @@ static int romfs_fill_super(struct super_block *sb, void *data, int silent)
533533

534534
root = romfs_iget(sb, pos);
535535
if (IS_ERR(root))
536-
goto error;
536+
return PTR_ERR(root);
537537

538538
sb->s_root = d_make_root(root);
539539
if (!sb->s_root)
540-
goto error;
540+
return -ENOMEM;
541541

542542
return 0;
543543

544-
error:
545-
return -EINVAL;
546544
error_rsb_inval:
547545
ret = -EINVAL;
548546
error_rsb:

0 commit comments

Comments
 (0)