summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2010-01-16 03:08:01 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2010-01-16 03:08:01 +0000
commitae3abf4daf0a58b15404798c197d8c28c8409bbe (patch)
treec52ba6e2f68ffbe3a1ccc503490c93639dfc7cbc /sys
parent29024cdc965c4a26e82e894cb44c7527f9e3e5f8 (diff)
When allocating from the item header pool, we can't sleep, as we may be holding a mutex which won't be released. From Christian Ehrhardt.
While here, fix another buglet: no need to pass down PR_ZERO either, as noticed by blambert@.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_pool.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index ddf9ddb3a9e..afaa783f16a 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.90 2009/09/05 16:06:57 thib Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.91 2010/01/16 03:08:00 tedu Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -434,9 +434,8 @@ pool_alloc_item_header(struct pool *pp, caddr_t storage, int flags)
if ((pp->pr_roflags & PR_PHINPAGE) != 0)
ph = (struct pool_item_header *)(storage + pp->pr_phoffset);
- else {
- ph = pool_get(&phpool, flags);
- }
+ else
+ ph = pool_get(&phpool, flags & ~(PR_WAITOK | PR_ZERO));
return (ph);
}