summaryrefslogtreecommitdiff
path: root/ctree.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 /ctree.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 'ctree.c')
-rw-r--r--ctree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ctree.c b/ctree.c
index a98ad185..d07ec7d9 100644
--- a/ctree.c
+++ b/ctree.c
@@ -2580,7 +2580,9 @@ int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root
unsigned long ptr;
path = btrfs_alloc_path();
- BUG_ON(!path);
+ if (!path)
+ return -ENOMEM;
+
ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size);
if (!ret) {
leaf = path->nodes[0];