Kldunload panics in uma_zfree()

From: Joseph Koshy <jkoshy_at_FreeBSD.ORG>
Date: Fri, 10 Jun 2005 17:08:02 +0000 (GMT)
I've been seeing this for a few days on a recent -current:

 # kldload MODULE 	# hwpmc. vkbd, etc.
 # kldunload MODULE

leads to a panic on the lines of:

 "uma: Freed item 0xc1af0260 did not belong to zone mt_zone\n"

The enclosed patch appears to fix the panic.  Could someone
review?

Index: kern_malloc.c
===================================================================
RCS file: /cvs/FreeBSD/src/sys/kern/kern_malloc.c,v
retrieving revision 1.140
diff -u -r1.140 kern_malloc.c
--- kern_malloc.c	29 May 2005 13:38:07 -0000	1.140
+++ kern_malloc.c	10 Jun 2005 16:45:51 -0000
_at__at_ -616,7 +616,7 _at__at_
 	} else
 		kmemstatistics = mtp->ks_next;
 	mtx_unlock(&malloc_mtx);
-	uma_zfree(mt_zone, mtp);
+	uma_zfree(mt_zone, mtip);
 }
 
 static int

Regards,
Koshy
<jkoshy_at_freebsd.org>
Received on Fri Jun 10 2005 - 15:08:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:36 UTC