In btrfs_find_last_root before returning with -ENOENT (if root item is
not found) free path and also remove btrfs_release_path before
btrfs_free_path because btrfs_free_path anyway calls it.
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
if (ret < 0)
goto out;
- if (path->slots[0] == 0)
- return -ENOENT;
+ if (path->slots[0] == 0) {
+ ret = -ENOENT;
+ goto out;
+ }
BUG_ON(ret == 0);
l = path->nodes[0];
memcpy(key, &found_key, sizeof(found_key));
ret = 0;
out:
- btrfs_release_path(path);
btrfs_free_path(path);
return ret;
}
write_extent_buffer(l, item, ptr, sizeof(*item));
btrfs_mark_buffer_dirty(path->nodes[0]);
out:
- btrfs_release_path(path);
btrfs_free_path(path);
return ret;
}