Fix: erroneous usage of addr parameter in mmap()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Aug 2016 15:43:13 +0000 (11:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Aug 2016 15:43:13 +0000 (11:43 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/kernel/select_poll_epoll.c

index 3b98ab415c9c9485cf6c255d77c203ee5f0bcc4b..592fbcab8809223ffb2104572566eb423c22f1f9 100644 (file)
@@ -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");
        }
This page took 0.028555 seconds and 4 git commands to generate.