From: Dan Carpenter Date: Tue, 1 Jun 2010 08:23:11 +0000 (+0000) Subject: Btrfs: uninitialized data is check_path_shared() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0e4dcbef1c0c3e29f9c7f824359445d385b2649a;p=linux-beck.git Btrfs: uninitialized data is check_path_shared() refs can be used with uninitialized data if btrfs_lookup_extent_info() fails on the first pass through the loop. In the original code if that happens then check_path_shared() probably returns 1, this patch changes it to return 1 for safety. Signed-off-by: Dan Carpenter Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d999c538cdc2..f08427c70a78 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2673,7 +2673,7 @@ static int check_path_shared(struct btrfs_root *root, struct extent_buffer *eb; int level; int ret; - u64 refs; + u64 refs = 1; for (level = 0; level < BTRFS_MAX_LEVEL; level++) { if (!path->nodes[level])