summaryrefslogtreecommitdiff
path: root/volumes.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-08-31 20:38:46 +0200
committerDavid Sterba <dsterba@suse.com>2016-09-21 14:12:38 +0200
commit1ef93ea8632b89598d7723a04a2d268b70333168 (patch)
tree48e911e91131e2023534ae8dbd652d245a039f15 /volumes.c
parentb318553f33dc59b6afdc7d264dcfbfe835ccc3d4 (diff)
btrfs-progs: handle errors from btrfs_alloc_path
All functions already return an error condition, so the callers should expect that. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/volumes.c b/volumes.c
index 2d07e66a..e022c16e 100644
--- a/volumes.c
+++ b/volumes.c
@@ -459,7 +459,8 @@ static int find_next_chunk(struct btrfs_root *root, u64 objectid, u64 *offset)
struct btrfs_key found_key;
path = btrfs_alloc_path();
- BUG_ON(!path);
+ if (!path)
+ return -ENOMEM;
key.objectid = objectid;
key.offset = (u64)-1;