Commit 3ca57bd6 authored by Misono Tomohiro's avatar Misono Tomohiro Committed by David Sterba

btrfs: Check error of btrfs_iget in btrfs_search_path_in_tree_user

The patch introducing the ioctl was not the latest version at the time
of merging to the mainline and needs a fixup from this patch.

Fixes: ba637a252d30 ("btrfs: Check error of btrfs_iget() in btrfs_search_path_in_tree_user")
Signed-off-by: default avatarMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 23d0b79d
...@@ -2438,6 +2438,10 @@ static int btrfs_search_path_in_tree_user(struct inode *inode, ...@@ -2438,6 +2438,10 @@ static int btrfs_search_path_in_tree_user(struct inode *inode,
} }
temp_inode = btrfs_iget(sb, &key2, root, NULL); temp_inode = btrfs_iget(sb, &key2, root, NULL);
if (IS_ERR(temp_inode)) {
ret = PTR_ERR(temp_inode);
goto out;
}
ret = inode_permission(temp_inode, MAY_READ | MAY_EXEC); ret = inode_permission(temp_inode, MAY_READ | MAY_EXEC);
iput(temp_inode); iput(temp_inode);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment