From 995509cfe298c1e145989aff18f9e3a161fff5d2 Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Wed, 19 Aug 2015 12:24:31 +0000 Subject: Make uvm_pmr_isfree() work correctly when RB_NFIND() returns an exact match. ok kettenis@ --- sys/uvm/uvm_pmemrange.c | 4 ++-- 1 file 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 @@ -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. */ -- cgit v1.2.3