and free(9).
The exception is at early boot when only one CPU is running since we
grab the KERNL_LOCK() relatively late in main().
ok kettenis@
-/* $OpenBSD: kern_malloc.c,v 1.128 2015/03/14 03:38:50 jsg Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.129 2017/06/07 13:30:36 mpi Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
panic("malloc: bogus type %d", type);
#endif
+ if (!cold)
+ KERNEL_ASSERT_LOCKED();
+
KASSERT(flags & (M_WAITOK | M_NOWAIT));
if ((flags & M_NOWAIT) == 0) {
struct kmemstats *ksp = &kmemstats[type];
#endif
+ if (!cold)
+ KERNEL_ASSERT_LOCKED();
+
if (addr == NULL)
return;