diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c index 43c17a1d3451..276f0eb874d4 100644 --- a/fs/btrfs/uuid-tree.c +++ b/fs/btrfs/uuid-tree.c @@ -35,7 +35,7 @@ static int btrfs_uuid_tree_lookup(struct btrfs_root *uuid_root, const u8 *uuid, struct btrfs_key key; if (WARN_ON_ONCE(!uuid_root)) - return -ENOENT; + return -EINVAL; path = btrfs_alloc_path(); if (!path) @@ -92,9 +92,6 @@ int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, const u8 *uuid, u8 typ if (ret != -ENOENT) return ret; - if (WARN_ON_ONCE(!uuid_root)) - return -EINVAL; - btrfs_uuid_to_key(uuid, type, &key); path = btrfs_alloc_path();