summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2021-10-17 11:39:41 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2021-10-17 11:39:41 +0000
commit101b3b14cab15854fbbc6b4f70f0ee0f609cd203 (patch)
tree969ee69289af7516c71e6bc896acc7a59dea2426 /sys
parent7401c4c46794c19425b0e91d4465325ef61b2553 (diff)
km_alloc(9) needs to be passed a size that is a multiple of PAGE_SIZE.
ok mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_page.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index ee40e958f92..a90b23af6df 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.c,v 1.158 2021/09/05 11:44:46 mpi Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.159 2021/10/17 11:39:40 patrick Exp $ */
/* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */
/*
@@ -542,8 +542,8 @@ uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
npages = end - start; /* # of pages */
- pgs = km_alloc(npages * sizeof(*pgs), &kv_any, &kp_zero,
- &kd_waitok);
+ pgs = km_alloc(round_page(npages * sizeof(*pgs)),
+ &kv_any, &kp_zero, &kd_waitok);
if (pgs == NULL) {
printf("uvm_page_physload: can not malloc vm_page "
"structs for segment\n");