summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Yudaken <dylany@fb.com>2022-04-22 09:01:26 -0700
committerJens Axboe <axboe@kernel.dk>2022-04-22 11:18:08 -0600
commit861c121c931d33dae4fbeeab3eac86544d856d9a (patch)
treeb49291bab7eeca00cf0e0168eafc5ff621ae401f
parent4ad972d6d1b16e4fb069fc2f006265942cf33103 (diff)
downloadliburing-861c121c931d33dae4fbeeab3eac86544d856d9a.tar.gz
liburing-861c121c931d33dae4fbeeab3eac86544d856d9a.tar.bz2
test: handle mmap return failures in pollfree test
Sometimes these mmap's fail, and it causes SEGFAULTS. I assume this was accidentally left off when this was originally landed. Signed-off-by: Dylan Yudaken <dylany@fb.com> Link: https://lore.kernel.org/r/20220422160132.2891927-2-dylany@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/pollfree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/pollfree.c b/test/pollfree.c
index e2511df..d753ffe 100644
--- a/test/pollfree.c
+++ b/test/pollfree.c
@@ -406,10 +406,10 @@ int main(int argc, char *argv[])
ret = mmap((void *)0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
if (ret == MAP_FAILED)
return 0;
- mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
+ ret = mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
if (ret == MAP_FAILED)
return 0;
- mmap((void *)0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
+ ret = mmap((void *)0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
if (ret == MAP_FAILED)
return 0;
loop();