[LTP] [PATCH] bugfix for epoll_ctl/epoll_ctl04.c

Wang Kunfeng threefifteen.wangkunfeng@huawei.com
Thu Mar 24 07:41:14 CET 2022


Add SAFE_CLOSE(new_epfd) to free fd

Signed-off-by: Wang Kunfeng <threefifteen.wangkunfeng@huawei.com>
---
 testcases/kernel/syscalls/epoll_ctl/epoll_ctl04.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/syscalls/epoll_ctl/epoll_ctl04.c b/testcases/kernel/syscalls/epoll_ctl/epoll_ctl04.c
index fce754e96..5173755f7 100644
--- a/testcases/kernel/syscalls/epoll_ctl/epoll_ctl04.c
+++ b/testcases/kernel/syscalls/epoll_ctl/epoll_ctl04.c
@@ -60,6 +60,7 @@ static void verify_epoll_ctl(void)
 	events.data.fd = epfd;
 	TST_EXP_FAIL(epoll_ctl(new_epfd, EPOLL_CTL_ADD, epfd, &events), EINVAL,
 		     "epoll_clt(..., EPOLL_CTL_ADD, ...) with number of nesting is 5");
+	SAFE_CLOSE(new_epfd);
 }

 static struct tst_test test = {

2.17.1



More information about the ltp mailing list