Skip to contentSkip to conversation

btrfs: fix compile warning of uninitialized value

PATCH New Kinglong Mee 1 participant 1 message Jan 29, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 btrfs: fix compile warning of uninitialized value

CC [M] fs/btrfs/extent-tree.o
fs/btrfs/extent-tree.c: In function 'find_free_extent':
fs/btrfs/extent-tree.c:7021:34: warning: 'used_bg' may be used uninitialized in this function [-Wmaybe-uninitialized]

  struct btrfs_block_group_cache *used_bg;
                                  ^
Fixes e570fd27f2 ("Btrfs: fix broken free space cache after the system crashed")
---
 fs/btrfs/extent-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/extent-tree.c +1 -1
index e2287c7..f24e4c3 100644
@@ -7018,7 +7018,7 @@ btrfs_lock_cluster(struct btrfs_block_group_cache *block_group,
 		   struct btrfs_free_cluster *cluster,
 		   int delalloc)
 {
-	struct btrfs_block_group_cache *used_bg;
+	struct btrfs_block_group_cache *used_bg = NULL;
 	bool locked = false;
 again:
 	spin_lock(&cluster->refill_lock);
Signature · 1 line
2.5.0