Commit 47bb27a2 authored by Chengfeng Ye's avatar Chengfeng Ye Committed by Alexei Starovoitov

selftests/bpf: Fix potential unreleased lock

This lock is not released if the program
return at the patched branch.
Signed-off-by: default avatarChengfeng Ye <cyeaa@connect.ust.hk>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210827074140.118671-1-cyeaa@connect.ust.hk
parent 48b2e71c
......@@ -195,8 +195,10 @@ static void run_test(int cgroup_fd)
pthread_mutex_lock(&server_started_mtx);
if (CHECK_FAIL(pthread_create(&tid, NULL, server_thread,
(void *)&server_fd)))
(void *)&server_fd))) {
pthread_mutex_unlock(&server_started_mtx);
goto close_server_fd;
}
pthread_cond_wait(&server_started, &server_started_mtx);
pthread_mutex_unlock(&server_started_mtx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment