Skip to content

Commit

Permalink
fs/romfs: correct error-handling code
Browse files Browse the repository at this point in the history
romfs_fill_super() assumes that romfs_iget() returns NULL when
it fails.  romfs_iget() actually returns ERR_PTR(-ve) in that
case...

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Julia Lawall authored and Al Viro committed Sep 24, 2009
1 parent f843980 commit 88a0a53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/romfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static int romfs_fill_super(struct super_block *sb, void *data, int silent)
pos = (ROMFH_SIZE + len + 1 + ROMFH_PAD) & ROMFH_MASK;

root = romfs_iget(sb, pos);
if (!root)
if (IS_ERR(root))
goto error;

sb->s_root = d_alloc_root(root);
Expand Down

0 comments on commit 88a0a53

Please sign in to comment.