diff options
author | David Sterba <dsterba@suse.com> | 2016-08-31 20:38:46 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-09-21 14:12:38 +0200 |
commit | 1ef93ea8632b89598d7723a04a2d268b70333168 (patch) | |
tree | 48e911e91131e2023534ae8dbd652d245a039f15 /disk-io.c | |
parent | b318553f33dc59b6afdc7d264dcfbfe835ccc3d4 (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 'disk-io.c')
-rw-r--r-- | disk-io.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -739,7 +739,11 @@ struct btrfs_root *btrfs_read_fs_root_no_cache(struct btrfs_fs_info *fs_info, root, fs_info, location->objectid); path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) { + free(root); + return ERR_PTR(-ENOMEM); + } + ret = btrfs_search_slot(NULL, tree_root, location, path, 0, 0); if (ret != 0) { if (ret > 0) |