summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pcm/sound.c')
-rw-r--r--sys/dev/sound/pcm/sound.c8
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
OpenPOWER on IntegriCloud