diff options
| author | Brian Somers <brian@FreeBSD.org> | 2009-06-05 09:16:52 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 2009-06-05 09:16:52 +0000 |
| commit | f121baaa45677ab30295056dd2ca5d5355998cb1 (patch) | |
| tree | 49838cc41951762d5ad9e7c30d84fc57cc64589d /sys/kern/kern_malloc.c | |
| parent | 29794416db9d20f409d1e8548359845b742822e8 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_malloc.c')
| -rw-r--r-- | sys/kern/kern_malloc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index e699a4e51e67..51045eed5afc 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -675,8 +675,8 @@ malloc_init(void *data) KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init")); mtp = data; - KASSERT(mtp->ks_magic == M_MAGIC, - ("malloc_init: bad malloc type magic")); + if (mtp->ks_magic != M_MAGIC) + panic("malloc_init: bad malloc type magic"); mtip = uma_zalloc(mt_zone, M_WAITOK | M_ZERO); mtp->ks_handle = mtip; @@ -709,9 +709,13 @@ malloc_uninit(void *data) if (mtp != kmemstatistics) { for (temp = kmemstatistics; temp != NULL; temp = temp->ks_next) { - if (temp->ks_next == mtp) + if (temp->ks_next == mtp) { temp->ks_next = mtp->ks_next; + break; + } } + KASSERT(temp, + ("malloc_uninit: type '%s' not found", mtp->ks_shortdesc)); } else kmemstatistics = mtp->ks_next; kmemcount--; |
