Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6536d289 authored by Dave Kleikamp's avatar Dave Kleikamp
Browse files

JFS: skip bad iput() call in error path



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: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
parent b2e03ca7
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -499,7 +499,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
	inode = jfs_iget(sb, ROOT_I);
	inode = jfs_iget(sb, ROOT_I);
	if (IS_ERR(inode)) {
	if (IS_ERR(inode)) {
		ret = PTR_ERR(inode);
		ret = PTR_ERR(inode);
		goto out_no_root;
		goto out_no_rw;
	}
	}
	sb->s_root = d_alloc_root(inode);
	sb->s_root = d_alloc_root(inode);
	if (!sb->s_root)
	if (!sb->s_root)
@@ -521,8 +521,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
	return 0;
	return 0;


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


out_no_rw:
out_no_rw: