FreeBSD Bugzilla – Attachment 147387 Details for
Bug 193696
CAM AC_FOUND_DEVICE calls malloc(M_WAITOK) from THREAD_NO_SLEEPING() context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
malloc M_WAITOK patch to assert THREAD_CAN_SLEEP
malloc.patch (text/plain), 549 bytes, created by
Scott M. Ferris
on 2014-09-16 21:51:15 UTC
(
hide
)
Description:
malloc M_WAITOK patch to assert THREAD_CAN_SLEEP
Filename:
MIME Type:
Creator:
Scott M. Ferris
Created:
2014-09-16 21:51:15 UTC
Size:
549 bytes
patch
obsolete
>diff --git i/sys/kern/kern_malloc.c w/sys/kern/kern_malloc.c >index c39f143..4706577 100644 >--- i/sys/kern/kern_malloc.c >+++ w/sys/kern/kern_malloc.c >@@ -472,9 +472,12 @@ malloc(unsigned long size, struct malloc_type *mtp, int flags) > } > } > #endif >- if (flags & M_WAITOK) >+ if (flags & M_WAITOK) { > KASSERT(curthread->td_intr_nesting_level == 0, > ("malloc(M_WAITOK) in interrupt context")); >+ KASSERT(THREAD_CAN_SLEEP(), >+ ("malloc(M_WAITOK) in no_sleeping context")); >+ } > > #ifdef DEBUG_MEMGUARD > if (memguard_cmp_mtp(mtp, size)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 193696
: 147387