btrfs-progs: Initialize ret to suppress compiler warning
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Thu, 1 Dec 2016 17:28:20 +0000 (11:28 -0600)
committerDavid Sterba <dsterba@suse.com>
Wed, 14 Dec 2016 14:06:35 +0000 (15:06 +0100)
The path that leaves ret unintialized goes through the second if block
and requires dback->found_ref to be 0. Quick search leads to several
places where it's set according to found items so we won't reach the for
loop with found_ref 0.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
[ updated changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c
qgroup-verify.c

index 64fdc0d..34209b0 100644 (file)
@@ -8041,7 +8041,7 @@ static int record_extent(struct btrfs_trans_handle *trans,
                         struct extent_backref *back,
                         int allocated, u64 flags)
 {
-       int ret;
+       int ret = 0;
        struct btrfs_root *extent_root = info->extent_root;
        struct extent_buffer *leaf;
        struct btrfs_key ins_key;
index 39762bf..ff46bc4 100644 (file)
@@ -1575,7 +1575,7 @@ out:
 
 int repair_qgroups(struct btrfs_fs_info *info, int *repaired)
 {
-       int ret;
+       int ret = 0;
        struct qgroup_count *count, *tmpcount;
 
        *repaired = 0;