From 1ef93ea8632b89598d7723a04a2d268b70333168 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 31 Aug 2016 20:38:46 +0200 Subject: 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 --- ctree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ctree.c') 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]; -- cgit v1.2.3