summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-09-28 10:03:05 +0000
committertedu <tedu@openbsd.org>2014-09-28 10:03:05 +0000
commitf2aa9532575926e96db769d3cc952aaf6b4457b6 (patch)
treeb941f86a4bcc24816cc748407ff2e1b10ddc9bf8 /sys/kern/subr_pool.c
parentI was mistaken: Nothing's wrong with contractions, they're just a normal (diff)
downloadwireguard-openbsd-f2aa9532575926e96db769d3cc952aaf6b4457b6.tar.xz
wireguard-openbsd-f2aa9532575926e96db769d3cc952aaf6b4457b6.zip
in pool_destroy, enter and leave mutex as necessary to satisfy assertions.
ok dlg
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 2f8c1366fcc..6f881e26295 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.160 2014/09/26 05:43:14 dlg Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.161 2014/09/28 10:03:05 tedu Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -385,7 +385,9 @@ pool_destroy(struct pool *pp)
/* Remove all pages */
while ((ph = LIST_FIRST(&pp->pr_emptypages)) != NULL) {
+ mtx_enter(&pp->pr_mtx);
pool_p_remove(pp, ph);
+ mtx_leave(&pp->pr_mtx);
pool_p_free(pp, ph);
}
KASSERT(LIST_EMPTY(&pp->pr_fullpages));