summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2011-09-23 07:27:09 +0000
committerdlg <dlg@openbsd.org>2011-09-23 07:27:09 +0000
commit645c633c09a4149329eb77fc8e79834c558b7aae (patch)
tree66ccc4abb1a26f6d8fac7f48de0f11977276f8d6 /sys/kern/subr_pool.c
parentAdd wildcard support to PermitOpen, allowing things like "PermitOpen (diff)
downloadwireguard-openbsd-645c633c09a4149329eb77fc8e79834c558b7aae.tar.xz
wireguard-openbsd-645c633c09a4149329eb77fc8e79834c558b7aae.zip
ph = pool_get(&phpool, PR_NOWAIT) can return NULL, so dont unconditionally
write to ph. ok blambert@ matthew@ deraadt@
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 101924a4ae6..b47065de5c0 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.108 2011/07/06 06:00:20 tedu Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.109 2011/09/23 07:27:09 dlg Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -447,7 +447,7 @@ pool_alloc_item_header(struct pool *pp, caddr_t storage, int flags)
else
ph = pool_get(&phpool, (flags & ~(PR_WAITOK | PR_ZERO)) |
PR_NOWAIT);
- if (pool_debug)
+ if (pool_debug && ph != NULL)
ph->ph_magic = PI_MAGIC;
return (ph);
}