WSL2-Linux-Kernel/fs/btrfs/tests
Filipe Manana b02a025dd1 btrfs: remove pointless and double ulist frees in error paths of qgroup tests
[ Upstream commit d0ea17aec1 ]

Several places in the qgroup self tests follow the pattern of freeing the
ulist pointer they passed to btrfs_find_all_roots() if the call to that
function returned an error. That is pointless because that function always
frees the ulist in case it returns an error.

Also In some places like at test_multiple_refs(), after a call to
btrfs_qgroup_account_extent() we also leave "old_roots" and "new_roots"
pointing to ulists that were freed, because btrfs_qgroup_account_extent()
has freed those ulists, and if after that the next call to
btrfs_find_all_roots() fails, we call ulist_free() on the "old_roots"
ulist again, resulting in a double free.

So remove those calls to reduce the code size and avoid double ulist
free in case of an error.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-26 09:24:32 +01:00
..
btrfs-tests.c btrfs: selftests: fix wrong error check in btrfs_free_dummy_root() 2022-11-16 09:58:27 +01:00
btrfs-tests.h btrfs: selftests: Add support for dummy devices 2020-01-23 17:24:34 +01:00
extent-buffer-tests.c btrfs: sink total_data parameter in setup_items_for_insert 2020-10-07 12:13:18 +02:00
extent-io-tests.c btrfs: tests: remove invalid extent-io test 2020-12-08 15:54:13 +01:00
extent-map-tests.c btrfs: fix typos in comments 2021-06-22 14:11:57 +02:00
free-space-tests.c btrfs: remove recalc_thresholds from free space ops 2020-12-09 19:16:06 +01:00
free-space-tree-tests.c btrfs: tests: remove if duplicate in __check_free_space_extents() 2020-07-27 12:55:27 +02:00
inode-tests.c btrfs: tests: initialize test inodes location 2020-12-18 14:59:49 +01:00
qgroup-tests.c btrfs: remove pointless and double ulist frees in error paths of qgroup tests 2022-11-26 09:24:32 +01:00