diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index f2740f65f8a..6baf62a8dc5 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -562,6 +562,9 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) void _mtx_assert(struct mtx *m, int what, const char *file, int line) { + + if (panicstr != NULL) + return; switch (what) { case MA_OWNED: case MA_OWNED | MA_RECURSED: diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index f2740f65f8a..6baf62a8dc5 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -562,6 +562,9 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) void _mtx_assert(struct mtx *m, int what, const char *file, int line) { + + if (panicstr != NULL) + return; switch (what) { case MA_OWNED: case MA_OWNED | MA_RECURSED: