提交 d4581fbc 编写于 作者: C Chengfeng Ye 提交者: Zheng Zengkai

selftests/bpf: Fix potential unreleased lock

stable inclusion
from stable-5.10.67
commit b1d547f2f51ace1caa2573e357d571cf1321ccb9
bugzilla: 182619 https://gitee.com/openeuler/kernel/issues/I4EWO7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b1d547f2f51ace1caa2573e357d571cf1321ccb9

--------------------------------

[ Upstream commit 47bb27a2 ]

This lock is not released if the program
return at the patched branch.
Signed-off-by: NChengfeng Ye <cyeaa@connect.ust.hk>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210827074140.118671-1-cyeaa@connect.ust.hkSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b024bf0b
...@@ -195,8 +195,10 @@ static void run_test(int cgroup_fd) ...@@ -195,8 +195,10 @@ static void run_test(int cgroup_fd)
pthread_mutex_lock(&server_started_mtx); pthread_mutex_lock(&server_started_mtx);
if (CHECK_FAIL(pthread_create(&tid, NULL, server_thread, 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; goto close_server_fd;
}
pthread_cond_wait(&server_started, &server_started_mtx); pthread_cond_wait(&server_started, &server_started_mtx);
pthread_mutex_unlock(&server_started_mtx); pthread_mutex_unlock(&server_started_mtx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册