summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-12-04 03:12:06 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-12-04 03:12:06 +0000
commit7b3313de475b03923d813e04d07b21f5a7855d07 (patch)
tree02669698cd610960da64b31d17fa7bf75f915c0c
parent5a88d67e9c477588bd33cfd2c9ea8779c789ca2d (diff)
init the mutex used in sleeping pool_gets with the right ipl if the
pool hasnt had pool_setipl called. ok kettenis@ ages ago
-rw-r--r--sys/kern/subr_pool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index e608614748f..2c0698f0b8c 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.168 2014/11/18 02:37:31 tedu Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.169 2014/12/04 03:12:05 dlg Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -434,8 +434,9 @@ pool_get(struct pool *pp, int flags)
yield();
if (v == NULL) {
- struct pool_get_memory mem =
- { MUTEX_INITIALIZER(pp->pr_ipl), NULL };
+ struct pool_get_memory mem = {
+ MUTEX_INITIALIZER((pp->pr_ipl == -1) ?
+ IPL_NONE : pp->pr_ipl), NULL };
struct pool_request pr;
pool_request_init(&pr, pool_get_done, &mem);