android_kernel_asus_sm8350/fs/btrfs/tests
Filipe Manana 6fa082ad96 btrfs: remove pointless and double ulist frees in error paths of qgroup tests
[ Upstream commit d0ea17aec12ea0f7b9d2ed727d8ef8169d1e7699 ]

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-25 17:42:13 +01:00
..
btrfs-tests.c btrfs: selftests: fix wrong error check in btrfs_free_dummy_root() 2022-11-25 17:42:09 +01:00
btrfs-tests.h
extent-buffer-tests.c
extent-io-tests.c btrfs: Correctly handle empty trees in find_first_clear_extent_bit 2020-02-11 04:35:34 -08:00
extent-map-tests.c btrfs: tests: add locks around add_extent_mapping 2019-07-01 13:35:03 +02:00
free-space-tests.c btrfs: move basic block_group definitions to their own header 2019-09-09 14:59:03 +02:00
free-space-tree-tests.c btrfs: return error pointer from alloc_test_extent_buffer 2019-12-31 16:41:57 +01:00
inode-tests.c btrfs: stop clearing EXTENT_DIRTY in inode I/O tree 2019-09-09 14:59:17 +02:00
qgroup-tests.c btrfs: remove pointless and double ulist frees in error paths of qgroup tests 2022-11-25 17:42:13 +01:00