From owner-freebsd-current@FreeBSD.ORG Wed Jul 28 13:14:14 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA2E1065675; Wed, 28 Jul 2010 13:14:13 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D78B68FC13; Wed, 28 Jul 2010 13:14:12 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA04089; Wed, 28 Jul 2010 16:14:11 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4C502D22.10800@icyb.net.ua> Date: Wed, 28 Jul 2010 16:14:10 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100517) MIME-Version: 1.0 To: Gavin Atkinson References: <20100726132451.GA18443@mech-cluster241.men.bris.ac.uk> <1280226205.78791.0.camel@buffy.york.ac.uk> <20100727115831.GA46325@mech-cluster241.men.bris.ac.uk> <1280238737.78791.20.camel@buffy.york.ac.uk> <20100727144703.GA46905@mech-cluster241.men.bris.ac.uk> <1280249605.78791.36.camel@buffy.york.ac.uk> In-Reply-To: <1280249605.78791.36.camel@buffy.york.ac.uk> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: free(sc, M_DEVBUF) [Was: amd64 panic snd_hda - hdac_get_capabilities: Invalid corb size (0)] 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: Wed, 28 Jul 2010 13:14:14 -0000 on 27/07/2010 19:53 Gavin Atkinson said the following: > > Thanks. Can you try > http://people.freebsd.org/~gavin/mexas-hda-panic.diff > > and see if that solves things for you? > > (Credit goes to avg@ for looking into this before me :) BTW, it seems that there is an epidemic of "free(sc, M_DEVBUF)" in sound drivers. And not only them, but I haven't looked at the other cases - perhaps the code there does something different and thus correct. glimpse -w M_DEVBUF | fgrep -w free | fgrep '(sc,' /usr/src/sys/dev/sound/pci/hda/hdac.c: free(sc, M_DEVBUF); /usr/src/sys/net/if_lagg.c: free(sc, M_DEVBUF); /usr/src/sys/net/if_lagg.c: free(sc, M_DEVBUF); /usr/src/sys/net/if_lagg.c: free(sc, M_DEVBUF); /usr/src/sys/net/if_bridge.c: free(sc, M_DEVBUF); /usr/src/sys/net/if_bridge.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/ich.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/ich.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/maestro3.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/maestro3.c: free(sc, M_DEVBUF); /usr/src/sys/net/if_enc.c: free(sc, M_DEVBUF); /usr/src/sys/sun4v/sun4v/simdisk.c: free(sc, M_DEVBUF); /usr/src/sys/dev/ofw/ofw_disk.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/isa/ess.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/sbus/cs4231.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/atiixp.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/emu10kx-pcm.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/emu10kx-pcm.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/emu10kx-pcm.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/ds1.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/ds1.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/cmi.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/cmi.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/neomagic.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/neomagic.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/neomagic.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/neomagic.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/solo.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/als4000.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/als4000.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/vibes.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/emu10k1.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/emu10k1.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/cs4281.c: free(sc, M_DEVBUF); /usr/src/sys/dev/sound/pci/cs4281.c: free(sc, M_DEVBUF); Good example of how get examples get multiplied. P.S. Actually all non-sound case seem to be correct, explicitly malloc-ed memory gets freed. -- Andriy Gapon