diff options
author | cognet <cognet@FreeBSD.org> | 2002-11-04 19:12:02 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2002-11-04 19:12:02 +0000 |
commit | 2b19845e44945f075ae6fa1d66b3275725f09bf8 (patch) | |
tree | 4d3dcfeb98ef4fa73017d17243fac44efe7baa65 /sys/dev/sound | |
parent | cbc958af4ef0458162f48a26cf9dec931bdfc6af (diff) | |
download | FreeBSD-src-2b19845e44945f075ae6fa1d66b3275725f09bf8.zip FreeBSD-src-2b19845e44945f075ae6fa1d66b3275725f09bf8.tar.gz |
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
Diffstat (limited to 'sys/dev/sound')
-rw-r--r-- | sys/dev/sound/pcm/sound.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index a733abf..3ee33d1 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 |