aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/queue_stack_map.c
diff options
context:
space:
mode:
authorXiyu Yang <[email protected]>2020-04-21 10:54:11 +0800
committerDavid Sterba <[email protected]>2020-04-23 17:24:52 +0200
commitf6033c5e333238f299c3ae03fac8cc1365b23b77 (patch)
treec3790aeb5cfc4238f320fffa97e4a629039f1480 /tools/testing/selftests/bpf/prog_tests/queue_stack_map.c
parentef67963dac255b293e19815ea3d440567be4626f (diff)
btrfs: fix block group leak when removing fails
btrfs_remove_block_group() invokes btrfs_lookup_block_group(), which returns a local reference of the block group that contains the given bytenr to "block_group" with increased refcount. When btrfs_remove_block_group() returns, "block_group" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in several exception handling paths of btrfs_remove_block_group(). When those error scenarios occur such as btrfs_alloc_path() returns NULL, the function forgets to decrease its refcnt increased by btrfs_lookup_block_group() and will cause a refcnt leak. Fix this issue by jumping to "out_put_group" label and calling btrfs_put_block_group() when those error scenarios occur. CC: [email protected] # 4.4+ Signed-off-by: Xiyu Yang <[email protected]> Signed-off-by: Xin Tan <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/queue_stack_map.c')
0 files changed, 0 insertions, 0 deletions