From: Josef Bacik Date: Fri, 18 Nov 2022 20:09:42 +0000 (-0500) Subject: btrfs: fix uninitialized variable in find_first_clear_extent_bit X-Git-Tag: v6.2-rc1~143^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26df39a9e5a8985674e814f0b27b25e8b4eb9ba7;p=thirdparty%2Fkernel%2Flinux.git btrfs: fix uninitialized variable in find_first_clear_extent_bit 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 Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 82ca6a11e11a2..9ae9cd1e70352 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -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);