Skip to contentSkip to conversation

btrfs: Fix warning: 'prev' may be used uninitialized in this function

PATCH New Jean Sacren 1 participant 2 messages Sep 11, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

cover btrfs: Fix warning: 'prev' may be used uninitialized in this function

Hi,

Self-explanatory warning message.

Jean Sacren (1):
btrfs: Fix warning: 'prev' may be used uninitialized in this function

 fs/btrfs/ordered-data.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Signature · 2 lines
Jean Sacren
Bring LAMP To People
#1 lore raw

PATCH 1/1 btrfs: Fix warning: 'prev' may be used uninitialized in this function

warning: 'prev' may be used uninitialized in this function

Initialize the variable 'prev' to NULL so that gcc doesn't complain.

---
 fs/btrfs/ordered-data.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/ordered-data.c +1 -1
index e56c72b..fad2616 100644
@@ -141,7 +141,7 @@ static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,
 					  u64 file_offset)
 {
 	struct rb_root *root = &tree->tree;
-	struct rb_node *prev;
+	struct rb_node *prev = NULL;
 	struct rb_node *ret;
 	struct btrfs_ordered_extent *entry;
 
Signature · 1 line
1.7.1