selftests/bpf: Destroy the skeleton when CONFIG_PREEMPT is off

Destroy the created skeleton when CONFIG_PREEMPT is off, else will be
resource leak.

Fixes: 73b97bc78b ("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>
This commit is contained in:
Hou Tao 2022-09-21 15:00:34 +08:00 committed by Martin KaFai Lau
parent b780d1671c
commit f5eb23b91c
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}