summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/vm/map_hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/vm/map_hugetlb.c')
-rw-r--r--tools/testing/selftests/vm/map_hugetlb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/vm/map_hugetlb.c b/tools/testing/selftests/vm/map_hugetlb.c
index ac56639dd4a9..addcd6fc1ecc 100644
--- a/tools/testing/selftests/vm/map_hugetlb.c
+++ b/tools/testing/selftests/vm/map_hugetlb.c
@@ -73,7 +73,11 @@ int main(void)
write_bytes(addr);
ret = read_bytes(addr);
- munmap(addr, LENGTH);
+ /* munmap() length of MAP_HUGETLB memory must be hugepage aligned */
+ if (munmap(addr, LENGTH)) {
+ perror("munmap");
+ exit(1);
+ }
return ret;
}
OpenPOWER on IntegriCloud