summaryrefslogtreecommitdiff
path: root/vm/map_hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm/map_hugetlb.c')
-rw-r--r--vm/map_hugetlb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vm/map_hugetlb.c b/vm/map_hugetlb.c
index ac56639..addcd6f 100644
--- a/vm/map_hugetlb.c
+++ b/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;
}