diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d29992f7dc6356b2de853f5dde76cebedc3e30d0..5556e9ea2a4b540659c2193e00f53615c9a3c652 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2438,6 +2438,10 @@ static int btrfs_search_path_in_tree_user(struct inode *inode, } 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); iput(temp_inode); if (ret) {