projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Btrfs: check return value of lookup_extent_mapping() correctly
[firefly-linux-kernel-4.4.55.git]
/
fs
/
btrfs
/
volumes.c
diff --git
a/fs/btrfs/volumes.c
b/fs/btrfs/volumes.c
index d8f282b5baa993b881cc6a91506d666825b34b96..cd040bf3fd87134bd36c76e40b29d7d0eab46b1d 100644
(file)
--- a/
fs/btrfs/volumes.c
+++ b/
fs/btrfs/volumes.c
@@
-1954,7
+1954,7
@@
static int btrfs_relocate_chunk(struct btrfs_root *root,
em = lookup_extent_mapping(em_tree, chunk_offset, 1);
read_unlock(&em_tree->lock);
em = lookup_extent_mapping(em_tree, chunk_offset, 1);
read_unlock(&em_tree->lock);
- BUG_ON(em->start > chunk_offset ||
+ BUG_ON(
!em ||
em->start > chunk_offset ||
em->start + em->len < chunk_offset);
map = (struct map_lookup *)em->bdev;
em->start + em->len < chunk_offset);
map = (struct map_lookup *)em->bdev;