summaryrefslogtreecommitdiff
path: root/powerpc/mm/hugetlb_vs_thp_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'powerpc/mm/hugetlb_vs_thp_test.c')
-rw-r--r--powerpc/mm/hugetlb_vs_thp_test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/powerpc/mm/hugetlb_vs_thp_test.c b/powerpc/mm/hugetlb_vs_thp_test.c
index 3d8e5b0..4900367 100644
--- a/powerpc/mm/hugetlb_vs_thp_test.c
+++ b/powerpc/mm/hugetlb_vs_thp_test.c
@@ -21,9 +21,13 @@ static int test_body(void)
* Typically the mmap will fail because no huge pages are
* allocated on the system. But if there are huge pages
* allocated the mmap will succeed. That's fine too, we just
- * munmap here before continuing.
+ * munmap here before continuing. munmap() length of
+ * MAP_HUGETLB memory must be hugepage aligned.
*/
- munmap(addr, SIZE);
+ if (munmap(addr, SIZE)) {
+ perror("munmap");
+ return 1;
+ }
}
p = mmap(addr, SIZE, PROT_READ | PROT_WRITE,