Skip to content

Commit

Permalink
romfs: fix returm err while getting inode in fill_super
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Rui Xiang authored and torvalds committed Jan 24, 2014
1 parent 3089a4c commit 40e2c71
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/romfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 40e2c71

Please sign in to comment.