summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-05-20 17:46:57 +0000
committerjhb <jhb@FreeBSD.org>2002-05-20 17:46:57 +0000
commitbb678d578d02468619b3bd655774c745c266e1ca (patch)
tree8a7344df34cfc2cf4ce712771fa914dc7229525d
parent85e17a3398f1107e494a29e42348c19281ac022a (diff)
downloadFreeBSD-src-bb678d578d02468619b3bd655774c745c266e1ca.zip
FreeBSD-src-bb678d578d02468619b3bd655774c745c266e1ca.tar.gz
Fix the td_intr_nesting_level check to work ok if a flag like M_ZERO is
passed in with M_WAITOK to malloc().
-rw-r--r--sys/kern/kern_malloc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 5e48278..042832d 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -157,11 +157,9 @@ malloc(size, type, flags)
if (size == 0)
Debugger("zero size malloc");
#endif
-#if defined(INVARIANTS)
- if (flags == M_WAITOK)
+ if (!(flags & M_NOWAIT))
KASSERT(curthread->td_intr_nesting_level == 0,
("malloc(M_WAITOK) in interrupt context"));
-#endif
if (size <= KMEM_ZMAX) {
if (size & KMEM_ZMASK)
size = (size & ~KMEM_ZMASK) + KMEM_ZBASE;
OpenPOWER on IntegriCloud