summaryrefslogtreecommitdiffstats
path: root/sys/uvm/uvm_pmemrange.c
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2011-04-06 12:31:10 +0000
committermlarkin <mlarkin@openbsd.org>2011-04-06 12:31:10 +0000
commit0d106c08932b937c6d1c3a14e9ca46277b1e00f9 (patch)
treee2a5f3f74453db7251db2f74ea94f620586d864e /sys/uvm/uvm_pmemrange.c
parentWhen specifying tos with -t, display a message if the returned packet (diff)
downloadwireguard-openbsd-0d106c08932b937c6d1c3a14e9ca46277b1e00f9.tar.xz
wireguard-openbsd-0d106c08932b937c6d1c3a14e9ca46277b1e00f9.zip
fix uvm_pmr_alloc_pig to return the proper pig range size
ok ariane
Diffstat (limited to 'sys/uvm/uvm_pmemrange.c')
-rw-r--r--sys/uvm/uvm_pmemrange.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
index 69f9cf1b11f..84f746694dc 100644
--- a/sys/uvm/uvm_pmemrange.c
+++ b/sys/uvm/uvm_pmemrange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.c,v 1.21 2011/04/05 22:33:51 ariane Exp $ */
+/* $OpenBSD: uvm_pmemrange.c,v 1.22 2011/04/06 12:31:10 mlarkin Exp $ */
/*
* Copyright (c) 2009, 2010 Ariane van der Steldt <ariane@stack.nl>
@@ -1891,6 +1891,8 @@ uvm_pmr_alloc_pig(paddr_t *addr, psize_t *sz)
pg = RB_MAX(uvm_pmr_size, &pmr->size[memtype]);
if (pg == NULL)
pg = TAILQ_FIRST(&pmr->single[memtype]);
+ else
+ pg--;
if (pig_pg == NULL || (pg != NULL && pig_pg != NULL &&
pig_pg->fpgsz < pg->fpgsz)) {