aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c
diff options
context:
space:
mode:
authorBrian Vazquez <[email protected]>2019-10-01 17:37:28 +0000
committerDaniel Borkmann <[email protected]>2019-10-01 22:58:07 +0000
commita2d074e4c6e81ec9ab359d54f0b88273c738de37 (patch)
treee6302a510716d7cdbe7654c7faf956d9dcc4e2b9 /tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c
parentselftests/bpf: test_progs: Don't leak server_fd in tcp_rtt (diff)
downloadkernel-a2d074e4c6e81ec9ab359d54f0b88273c738de37.tar.gz
kernel-a2d074e4c6e81ec9ab359d54f0b88273c738de37.zip
selftests/bpf: test_progs: Don't leak server_fd in test_sockopt_inherit
server_fd needs to be closed if pthread can't be created. Fixes: e3e02e1d9c24 ("selftests/bpf: test_progs: convert test_sockopt_inherit") Signed-off-by: Brian Vazquez <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Stanislav Fomichev <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c b/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c
index 6cbeea7b4bf1..8547ecbdc61f 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockopt_inherit.c
@@ -195,7 +195,7 @@ static void run_test(int cgroup_fd)
if (CHECK_FAIL(pthread_create(&tid, NULL, server_thread,
(void *)&server_fd)))
- goto close_bpf_object;
+ goto close_server_fd;
pthread_mutex_lock(&server_started_mtx);
pthread_cond_wait(&server_started, &server_started_mtx);