From: Jérémie Galarneau Date: Wed, 3 Aug 2016 15:43:13 +0000 (-0400) Subject: Fix: erroneous usage of addr parameter in mmap() X-Git-Tag: v2.9.0-rc1~73 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=36bc42d93bfb26c02e17135ab4e0d6825418bee3;p=lttng-tools.git Fix: erroneous usage of addr parameter in mmap() Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/kernel/select_poll_epoll.c b/tests/regression/kernel/select_poll_epoll.c index 3b98ab415..592fbcab8 100644 --- a/tests/regression/kernel/select_poll_epoll.c +++ b/tests/regression/kernel/select_poll_epoll.c @@ -723,17 +723,15 @@ void epoll_pwait_concurrent_munmap(void) int ret, epollfd, i, fds[MAX_FDS]; char buf[BUF_SIZE]; struct epoll_event *epoll_event; - void *addr = NULL; pthread_t writer; - epollfd = epoll_create(MAX_FDS); if (epollfd < 0) { perror("[eppoll] create"); goto end; } - epoll_event = mmap(addr, MAX_FDS * sizeof(struct epoll_event), + epoll_event = mmap(NULL, MAX_FDS * sizeof(struct epoll_event), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (epoll_event == MAP_FAILED) { @@ -790,7 +788,7 @@ end_unmap: } } - ret = munmap(addr, MAX_FDS * sizeof(struct epoll_event)); + ret = munmap(epoll_event, MAX_FDS * sizeof(struct epoll_event)); if (ret != 0) { perror("munmap"); }