summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/vm/hugetlbfstest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/vm/hugetlbfstest.c')
-rw-r--r--tools/testing/selftests/vm/hugetlbfstest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/hugetlbfstest.c b/tools/testing/selftests/vm/hugetlbfstest.c
index ea40ff8c2391..02e1072ec187 100644
--- a/tools/testing/selftests/vm/hugetlbfstest.c
+++ b/tools/testing/selftests/vm/hugetlbfstest.c
@@ -34,6 +34,7 @@ static void do_mmap(int fd, int extra_flags, int unmap)
int *p;
int flags = MAP_PRIVATE | MAP_POPULATE | extra_flags;
u64 before, after;
+ int ret;
before = read_rss();
p = mmap(NULL, length, PROT_READ | PROT_WRITE, flags, fd, 0);
@@ -44,7 +45,8 @@ static void do_mmap(int fd, int extra_flags, int unmap)
!"rss didn't grow as expected");
if (!unmap)
return;
- munmap(p, length);
+ ret = munmap(p, length);
+ assert(!ret || !"munmap returned an unexpected error");
after = read_rss();
assert(llabs(after - before) < 0x40000 ||
!"rss didn't shrink as expected");