Fix the td_intr_nesting_level check to work ok if a flag like M_ZERO is

passed in with M_WAITOK to malloc().
This commit is contained in:
John Baldwin 2002-05-20 17:46:57 +00:00
parent 184fec1a09
commit 42e498655d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97005

View file

@ -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;