summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2011-04-19 15:59:12 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2011-04-19 15:59:12 +0000
commit38ed60bfabafbacd7fef4320df7847c29ea28be0 (patch)
tree9b3f675e4ee3e13b205ab8a55486b76362683ecf /sys/uvm
parentc0dd304cd5b53640325a7411d3a7ebbd654a53b9 (diff)
Free the correct pages when we failed to allocate va.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_km.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c
index 4d5c29c40e9..d13cdde1cd5 100644
--- a/sys/uvm/uvm_km.c
+++ b/sys/uvm/uvm_km.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_km.c,v 1.97 2011/04/18 19:23:46 art Exp $ */
+/* $OpenBSD: uvm_km.c,v 1.98 2011/04/19 15:59:11 art Exp $ */
/* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */
/*
@@ -928,7 +928,8 @@ alloc_va:
while (uvm_km_pages.free == 0) {
if (kd->kd_waitok == 0) {
mtx_leave(&uvm_km_pages.mtx);
- uvm_pagefree(pg);
+ if (!TAILQ_EMPTY(&pgl))
+ uvm_pglistfree(&pgl);
return NULL;
}
msleep(&uvm_km_pages.free, &uvm_km_pages.mtx, PVM,
@@ -961,6 +962,8 @@ try_map:
tsleep(map, PVM, "km_allocva", 0);
goto try_map;
}
+ if (!TAILQ_EMPTY(&pgl))
+ uvm_pglistfree(&pgl);
return (NULL);
}
}