summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2014-12-22 22:22:36 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2014-12-22 22:22:36 +0000
commit7d380ffe5848702fca867891cc9c966e5d7b9372 (patch)
treef3138988a37729988df0a56e29a57d20df4d6cc5 /sys/kern
parentedc52f510dbd208d47bfce3220f798059aadf8a3 (diff)
fix an error in piglet allocation when requesting an alignment < PAGE_SIZE
(which we never did, but it was a bug nonetheless). ok kettenis, deraadt
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_hibernate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index e689acad7d8..114da7c1430 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.110 2014/12/17 19:42:15 tedu Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.111 2014/12/22 22:22:35 mlarkin Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -468,7 +468,8 @@ uvm_pmr_alloc_piglet(vaddr_t *va, paddr_t *pa, vsize_t sz, paddr_t align)
* pmemrange uses internally.
*/
if (align < PAGE_SIZE)
- align = PAGE_SIZE;
+ kp_piglet.kp_align = PAGE_SIZE;
+
sz = round_page(sz);
*va = (vaddr_t)km_alloc(sz, &kv_any, &kp_piglet, &kd_nowait);