struct extent_buffer *leaf;
path = btrfs_alloc_path();
+ if (!path)
+ return -ENOMEM;
+
key.objectid = (u64)-1;
key.offset = (u64)-1;
key.type = (u8)-1;
if (ret)
goto free_out;
}
- btrfs_free_path(path);
+ btrfs_release_path(path);
/* Here, cow and ins_len must equals 0 for the following reasons:
* 1) chunk recover is based on disk scanning, so COW should be
* 2) if cow = 0, ins_len must also be set to 0, or BUG_ON will be
* triggered.
*/
- path = btrfs_alloc_path();
ret = btrfs_search_slot(trans, root, &key, path, 0, 0);
BUG_ON(ret == 0);
if (ret < 0) {
print_usage();
del = rand() % 3;
path = btrfs_alloc_path();
+ if (!path) {
+ fprintf(stderr, "path allocation failed\n");
+ goto out_close;
+ }
if (find_chunk_offset(root->fs_info->chunk_root, path,
logical) != 0) {