OSDN Git Service

btrfs: fix uninitialized ret in ref-verify
authorJosef Bacik <josef@toxicpanda.com>
Wed, 2 Oct 2019 14:03:36 +0000 (10:03 -0400)
committerDavid Sterba <dsterba@suse.com>
Thu, 3 Oct 2019 13:00:56 +0000 (15:00 +0200)
commitc5f4987e86f6692fdb12533ea1fc7a7bb98e555a
tree80dabb48e049292e0246f5200b3934dddc31edd0
parent11a19a90870ea5496a8ded69b86f5b476b6d3355
btrfs: fix uninitialized ret in ref-verify

Coverity caught a case where we could return with a uninitialized value
in ret in process_leaf.  This is actually pretty likely because we could
very easily run into a block group item key and have a garbage value in
ret and think there was an errror.  Fix this by initializing ret to 0.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: fd708b81d972 ("Btrfs: add a extent ref verify tool")
CC: stable@vger.kernel.org # 4.19+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ref-verify.c