Skip to content

Commit

Permalink
selftests/bpf: Destroy the skeleton when CONFIG_PREEMPT is off
Browse files Browse the repository at this point in the history
Destroy the created skeleton when CONFIG_PREEMPT is off, else will be
resource leak.

Fixes: 73b97bc ("selftests/bpf: Test concurrent updates on bpf_task_storage_busy")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20220921070035.2016413-2-houtao@huaweicloud.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
  • Loading branch information
Hou Tao authored and Martin KaFai Lau committed Sep 22, 2022
1 parent b780d16 commit f5eb23b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/map_tests/task_storage_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void test_task_storage_map_stress_lookup(void)
/* Only for a fully preemptible kernel */
if (!skel->kconfig->CONFIG_PREEMPT) {
printf("%s SKIP (no CONFIG_PREEMPT)\n", __func__);
read_bpf_task_storage_busy__destroy(skel);
skips++;
return;
}
Expand Down

0 comments on commit f5eb23b

Please sign in to comment.