diff options
author | David Sterba <dsterba@suse.com> | 2016-09-06 13:08:29 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-09-21 14:12:38 +0200 |
commit | 40ca1d513d97c71aad79953bbc3bb56ddea7adc5 (patch) | |
tree | 190a9c74bde728febd27e382a5f559d1afe6c30f | |
parent | 28fdd0d2ae35f02f78b29da2d119b673c7855c37 (diff) |
btrfs-progs: check: improved error handling in calc_extent_flag
All callers handle errors.
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | cmds-check.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c index df97d3b6..aff3c03d 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); /* |