summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/uvm/uvm_page.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index b904577a544..2e75a67366b 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.c,v 1.126 2013/06/11 19:01:20 beck Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.127 2013/06/21 21:42:17 kettenis Exp $ */
/* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */
/*
@@ -916,7 +916,6 @@ uvm_pagerealloc_multi(struct uvm_object *obj, voff_t off, vsize_t size,
int i,r;
voff_t offset;
-
TAILQ_INIT(&plist);
if (size == 0)
panic("size 0 uvm_pagerealloc");
@@ -928,11 +927,14 @@ uvm_pagerealloc_multi(struct uvm_object *obj, voff_t off, vsize_t size,
while((pg = TAILQ_FIRST(&plist)) != NULL) {
offset = off + ptoa(i++);
tpg = uvm_pagelookup(obj, offset);
+ KASSERT(tpg != NULL);
pg->wire_count = 1;
atomic_setbits_int(&pg->pg_flags, PG_CLEAN | PG_FAKE);
KASSERT((pg->pg_flags & PG_DEV) == 0);
TAILQ_REMOVE(&plist, pg, pageq);
uvm_pagecopy(tpg, pg);
+ KASSERT(tpg->wire_count == 1);
+ tpg->wire_count = 0;
uvm_pagefree(tpg);
uvm_pagealloc_pg(pg, obj, offset, NULL);
}