summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAriane van der Steldt <ariane@cvs.openbsd.org>2011-06-01 22:29:26 +0000
committerAriane van der Steldt <ariane@cvs.openbsd.org>2011-06-01 22:29:26 +0000
commit6fa12be07231784adc793eb02169167a7e701547 (patch)
treeb4dfaebde40f5a481feaac65bb75f077fd746f04 /sys
parent0e1de46329ae299e224a8234e6ad135d6eed3c9e (diff)
Oops, I broke randomness. (Please upgrade, this is _bad_.)
sel_addr &= ~(pmap_align - 1); with pmap_align allowed to be 0 (no PMAP_PREFER) is a bad idea. Fix this by a conditional. ok oga@
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 8d2c1b34c49..1d22ee61ec6 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.138 2011/05/29 17:18:22 ariane Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.139 2011/06/01 22:29:25 ariane Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -924,7 +924,8 @@ pmap_prefer_retry:
* a page.
*/
sel_addr &= ~(align - 1);
- sel_addr &= ~(pmap_align - 1);
+ if (pmap_align != 0)
+ sel_addr &= ~(pmap_align - 1);
KDASSERT(sel_addr <= sel_max - sel_min);
/*