diff options
author | green <green@FreeBSD.org> | 2003-02-11 16:58:54 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2003-02-11 16:58:54 +0000 |
commit | 127c3ce1218a94d7fd87aed375b2f1cede02dc54 (patch) | |
tree | 55a82cc988f97642d21ea51120f837501fb7a17f /sys | |
parent | 743c9a258c2f978b235f54eb144c80b098f2b072 (diff) | |
download | FreeBSD-src-127c3ce1218a94d7fd87aed375b2f1cede02dc54.zip FreeBSD-src-127c3ce1218a94d7fd87aed375b2f1cede02dc54.tar.gz |
Sound devices were being leaked by dsp_open() not actually releasing the
channels it allocates if chn_reset() on them resulted in failure.
ARROW'D!
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index dd69dcf..f2d463c 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -274,8 +274,11 @@ dsp_open(dev_t i_dev, int flags, int mode, struct thread *td) if (chn_reset(rdch, fmt)) { pcm_lock(d); pcm_chnrelease(rdch); - if (wrch && (flags & FWRITE)) + i_dev->si_drv1 = NULL; + if (wrch && (flags & FWRITE)) { pcm_chnrelease(wrch); + i_dev->si_drv2 = NULL; + } pcm_unlock(d); splx(s); return ENODEV; @@ -289,10 +292,12 @@ dsp_open(dev_t i_dev, int flags, int mode, struct thread *td) if (chn_reset(wrch, fmt)) { pcm_lock(d); pcm_chnrelease(wrch); + i_dev->si_drv2 = NULL; if (flags & FREAD) { CHN_LOCK(rdch); pcm_chnref(rdch, -1); pcm_chnrelease(rdch); + i_dev->si_drv1 = NULL; } pcm_unlock(d); splx(s); |