diff --git a/sys/vm/uma_dbg.c b/sys/vm/uma_dbg.c index c256e62875c0..2f6360699419 100644 --- a/sys/vm/uma_dbg.c +++ b/sys/vm/uma_dbg.c @@ -165,7 +165,11 @@ mtrash_ctor(void *mem, int size, void *arg, int flags) off = (uintptr_t)p - (uintptr_t)mem; ksp = (struct malloc_type **)mem; ksp += size / sizeof(struct malloc_type *); - if (*ksp != NULL && INKERNEL((uintptr_t)*ksp)) { + if (*ksp != NULL +#ifdef INKERNEL + && INKERNEL((uintptr_t)*ksp) +#endif + ) { /* * If *ksp is corrupted we may be unable to panic clean, * so print what we have reliably while we still can.