summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent-io-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-12-16 23:15:55 +0300
committerDavid Sterba <dsterba@suse.com>2023-02-13 19:50:33 +0300
commit598643250c47c2a2e2339f25e2be36165eb229a9 (patch)
treeb88fb7f8f0cd1fe8922d705b42b59000785800e7 /fs/btrfs/extent-io-tree.c
parentefbf35a102b20246cfe4409c6ae92e72ecb67ab8 (diff)
downloadlinux-598643250c47c2a2e2339f25e2be36165eb229a9.tar.xz
btrfs: fix uninitialized variable warnings in __set_extent_bit and convert_extent_bit
We will pass in the parent and p pointer into our tree_search function to avoid doing a second search when inserting a new extent state into the tree. However because this is conditional upon passing in these pointers the compiler seems to think these values can be uninitialized if we're using -Wmaybe-uninitialized. Fix this by initializing these values. Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-io-tree.c')
-rw-r--r--fs/btrfs/extent-io-tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c
index 3c7766dfaa69..b2bab7672340 100644
--- a/fs/btrfs/extent-io-tree.c
+++ b/fs/btrfs/extent-io-tree.c
@@ -972,8 +972,8 @@ static int __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
{
struct extent_state *state;
struct extent_state *prealloc = NULL;
- struct rb_node **p;
- struct rb_node *parent;
+ struct rb_node **p = NULL;
+ struct rb_node *parent = NULL;
int err = 0;
u64 last_start;
u64 last_end;
@@ -1218,8 +1218,8 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
{
struct extent_state *state;
struct extent_state *prealloc = NULL;
- struct rb_node **p;
- struct rb_node *parent;
+ struct rb_node **p = NULL;
+ struct rb_node *parent = NULL;
int err = 0;
u64 last_start;
u64 last_end;