Skip to content

Commit

Permalink
JFS: skip bad iput() call in error path
Browse files Browse the repository at this point in the history
If jfs_iget() fails, we can't call iput() on the returned error.
Thanks to Eric Sesterhenn's fuzzer testing for reporting the problem.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
  • Loading branch information
Dave Kleikamp committed May 21, 2008
1 parent b2e03ca commit 6536d28
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/jfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
inode = jfs_iget(sb, ROOT_I);
if (IS_ERR(inode)) {
ret = PTR_ERR(inode);
goto out_no_root;
goto out_no_rw;
}
sb->s_root = d_alloc_root(inode);
if (!sb->s_root)
Expand All @@ -521,9 +521,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
return 0;

out_no_root:
jfs_err("jfs_read_super: get root inode failed");
if (inode)
iput(inode);
jfs_err("jfs_read_super: get root dentry failed");
iput(inode);

out_no_rw:
rc = jfs_umount(sb);
Expand Down

0 comments on commit 6536d28

Please sign in to comment.