From: David Sterba Date: Tue, 6 Sep 2016 11:08:29 +0000 (+0200) Subject: btrfs-progs: check: improved error handling in calc_extent_flag X-Git-Tag: upstream/4.16.1~1278 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40ca1d513d97c71aad79953bbc3bb56ddea7adc5;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: check: improved error handling in calc_extent_flag All callers handle errors. Signed-off-by: David Sterba --- diff --git a/cmds-check.c b/cmds-check.c index df97d3b..aff3c03 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -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); /*