aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 71cd456fdb6..aa91773fe31 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -667,7 +667,9 @@ int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len)
667 struct btrfs_path *path; 667 struct btrfs_path *path;
668 668
669 path = btrfs_alloc_path(); 669 path = btrfs_alloc_path();
670 BUG_ON(!path); 670 if (!path)
671 return -ENOMEM;
672
671 key.objectid = start; 673 key.objectid = start;
672 key.offset = len; 674 key.offset = len;
673 btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); 675 btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
@@ -5494,7 +5496,8 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
5494 u32 size = sizeof(*extent_item) + sizeof(*block_info) + sizeof(*iref); 5496 u32 size = sizeof(*extent_item) + sizeof(*block_info) + sizeof(*iref);
5495 5497
5496 path = btrfs_alloc_path(); 5498 path = btrfs_alloc_path();
5497 BUG_ON(!path); 5499 if (!path)
5500 return -ENOMEM;
5498 5501
5499 path->leave_spinning = 1; 5502 path->leave_spinning = 1;
5500 ret = btrfs_insert_empty_item(trans, fs_info->extent_root, path, 5503 ret = btrfs_insert_empty_item(trans, fs_info->extent_root, path,
@@ -7162,7 +7165,10 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
7162 spin_unlock(&cluster->refill_lock); 7165 spin_unlock(&cluster->refill_lock);
7163 7166
7164 path = btrfs_alloc_path(); 7167 path = btrfs_alloc_path();
7165 BUG_ON(!path); 7168 if (!path) {
7169 ret = -ENOMEM;
7170 goto out;
7171 }
7166 7172
7167 inode = lookup_free_space_inode(root, block_group, path); 7173 inode = lookup_free_space_inode(root, block_group, path);
7168 if (!IS_ERR(inode)) { 7174 if (!IS_ERR(inode)) {