mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
selftests: harness: fix pidfd leak in __wait_for_test
Fix the pidfd leak in kselftest_harness.h's __wait_for_test() where
childfd = syscall(__NR_pidfd_open, t->pid, 0) is never closed.
Fixes: 73a3cde976 ("selftests: harness: Implement test timeouts through pidfd")
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Link: https://patch.msgid.link/a82e275ccfb2609a1984d90ab559fa3af78f1e81.1776678050.git.tanggeliang@kylinos.cn
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
parent
62c4d31d78
commit
0eb307d613
|
|
@ -996,6 +996,7 @@ static void __wait_for_test(struct __test_metadata *t)
|
|||
poll_child.fd = childfd;
|
||||
poll_child.events = POLLIN;
|
||||
ret = poll(&poll_child, 1, t->timeout * 1000);
|
||||
close(childfd);
|
||||
if (ret == -1) {
|
||||
t->exit_code = KSFT_FAIL;
|
||||
fprintf(TH_LOG_STREAM,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user