summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_pmemrange.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2015-08-19 12:24:31 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2015-08-19 12:24:31 +0000
commit995509cfe298c1e145989aff18f9e3a161fff5d2 (patch)
tree4d76de2a96f5bd1e142a69034dda6496b159f220 /sys/uvm/uvm_pmemrange.c
parent8f2dc22395cd693dd16efa1e3fbd5ba2caa18d2b (diff)
Make uvm_pmr_isfree() work correctly when RB_NFIND() returns
an exact match. ok kettenis@
Diffstat (limited to 'sys/uvm/uvm_pmemrange.c')
-rw-r--r--sys/uvm/uvm_pmemrange.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
index 3c51056ea22..cee67c0a721 100644
--- a/sys/uvm/uvm_pmemrange.c
+++ b/sys/uvm/uvm_pmemrange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.c,v 1.46 2015/06/27 21:25:55 miod Exp $ */
+/* $OpenBSD: uvm_pmemrange.c,v 1.47 2015/08/19 12:24:30 visa Exp $ */
/*
* Copyright (c) 2009, 2010 Ariane van der Steldt <ariane@stack.nl>
@@ -1557,7 +1557,7 @@ uvm_pmr_isfree(struct vm_page *pg)
r = RB_NFIND(uvm_pmr_addr, &pmr->addr, pg);
if (r == NULL)
r = RB_MAX(uvm_pmr_addr, &pmr->addr);
- else
+ else if (r != pg)
r = RB_PREV(uvm_pmr_addr, &pmr->addr, r);
if (r == NULL)
return 0; /* Empty tree. */