btrfs-progs: check: improved error handling in calc_extent_flag

All callers handle errors.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-09-06 13:08:29 +02:00
parent 28fdd0d2ae
commit 40ca1d513d
1 changed files with 3 additions and 1 deletions

View File

@ -6047,7 +6047,9 @@ static int calc_extent_flag(struct btrfs_root *root,
cache = lookup_cache_extent(extent_cache, buf->start, 1);
/* we have added this extent before */
BUG_ON(!cache);
if (!cache)
return -ENOENT;
rec = container_of(cache, struct extent_record, cache);
/*