Skip to contentSkip to conversation

btrfs: set root to null in btrfs_search_path_in_tree_user

PATCH In review Josef Bacik 2 participants 2 messages Feb 27, 2020 – Feb 28, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

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.

---
- 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
index 0bd691055e51..92cb38c9889a 100644
@@ -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