mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 09:43:47 +00:00
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:
parent
184fec1a09
commit
42e498655d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97005
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue