From owner-freebsd-current@FreeBSD.ORG Fri Jun 10 17:08:02 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 729) id 2B5A816A41F; Fri, 10 Jun 2005 17:08:02 +0000 (GMT) X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 To: freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain Message-Id: <20050610170802.2B5A816A41F@hub.freebsd.org> Date: Fri, 10 Jun 2005 17:08:02 +0000 (GMT) From: jkoshy@FreeBSD.ORG (Joseph Koshy) Cc: jkoshy@FreeBSD.ORG Subject: Kldunload panics in uma_zfree() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 17:08:02 -0000 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 @@ -616,7 +616,7 @@ } else kmemstatistics = mtp->ks_next; mtx_unlock(&malloc_mtx); - uma_zfree(mt_zone, mtp); + uma_zfree(mt_zone, mtip); } static int Regards, Koshy