From e33bee0756c0e3a296ce05798a9c896eb33f844f Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Mon, 4 Nov 2002 19:12:02 +0000 Subject: [PATCH] Call pcm_chn_destroy() in pcm_killchan() so that channel mutexes are destroyed and struct pcm_channel freed. Reviewed by: cg MFC after: 3 days --- sys/dev/sound/pcm/sound.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index a733abfa58e..3ee33d1d5ab 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -522,12 +522,18 @@ pcm_killchan(device_t dev) { struct snddev_info *d = device_get_softc(dev); struct snddev_channel *sce; + struct pcm_channel *ch; + int error = 0; snd_mtxlock(d->lock); sce = SLIST_FIRST(&d->channels); snd_mtxunlock(d->lock); + ch = sce->channel; - return pcm_chn_remove(d, sce->channel, 1); + error = pcm_chn_remove(d, sce->channel, 1); + if (error) + return (error); + return (pcm_chn_destroy(ch)); } int