]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: fix uninitialized variable in find_first_clear_extent_bit
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Nov 2022 20:09:42 +0000 (15:09 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:59 +0000 (18:00 +0100)
This was caught when syncing extent-io-tree.c into btrfs-progs.  This
however isn't really a problem, the only way next would be uninitialized
is if we found the range we were looking for, and in this case we don't
care about next.  However it's a compile error, so fix it up.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c

index 82ca6a11e11a2b2ec0ff3c0ffc1a4606348286d5..9ae9cd1e70352a615de5cfcf07a9353632c931d6 100644 (file)
@@ -1425,7 +1425,7 @@ void find_first_clear_extent_bit(struct extent_io_tree *tree, u64 start,
                                 u64 *start_ret, u64 *end_ret, u32 bits)
 {
        struct extent_state *state;
-       struct extent_state *prev = NULL, *next;
+       struct extent_state *prev = NULL, *next = NULL;
 
        spin_lock(&tree->lock);