btrfs: set root to null in btrfs_search_path_in_tree_user
PATCH 1/1 btrfs: set root to null in btrfs_search_path_in_tree_user
We could potentially have root uninitialized in some cases, so this will cause problems with btrfs_put_root.
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Josef Bacik <[email protected]>
---
- Dave, this can be folded into "btrfs: hold a ref on the root in btrfs_search_path_in_tree_user"
fs/btrfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/ioctl.c +1 -1
@@ -2388,7 +2388,7 @@ static int btrfs_search_path_in_tree_user(struct inode *inode,unsigned long item_len;struct btrfs_inode_ref *iref;struct btrfs_root_ref *rref; -struct btrfs_root *root; +struct btrfs_root *root =NULL ;struct btrfs_path *path;struct btrfs_key key, key2;struct extent_buffer *leaf;
Signature · 1 line
2.24.1
Quoted 8 lines · Josef Bacik
We could potentially have root uninitialized in some cases, so this will cause problems with
btrfs_put_root.Reported-by Dan Carpenter <[email protected]>Signed-off-by Josef Bacik <[email protected]>---
- Dave, this can be folded into "btrfs: hold a ref on the root inbtrfs_search_path_in_tree_user"
Folded, thanks.