summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/sound.c
diff options
context:
space:
mode:
authorgreid <greid@FreeBSD.org>2001-09-14 20:26:03 +0000
committergreid <greid@FreeBSD.org>2001-09-14 20:26:03 +0000
commit395572e2f3bfaec9f72ad71a93edb96074fb4e86 (patch)
treed055c668fdb2453bd06433c7b4e1977eed011d69 /sys/dev/sound/pcm/sound.c
parenteb6b3d396e0aa9c8154a3b9ee5c0d20385992ec0 (diff)
downloadFreeBSD-src-395572e2f3bfaec9f72ad71a93edb96074fb4e86.zip
FreeBSD-src-395572e2f3bfaec9f72ad71a93edb96074fb4e86.tar.gz
- Correctly increment the channel refcount in dsp_open() such that it is
no longer possible to unload the driver module while sound is playing (which resulted in a panic). - Fix a similar problem with the sndstat device that I found while looking at the above. - Append a newline character to error messages in pcm_unregister() Reviewed by: cg MFC after: 10 days
Diffstat (limited to 'sys/dev/sound/pcm/sound.c')
-rw-r--r--sys/dev/sound/pcm/sound.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index f8b2592..f46c4b6 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -609,19 +609,24 @@ pcm_unregister(device_t dev)
snd_mtxlock(d->lock);
if (d->inprog) {
- device_printf(dev, "unregister: operation in progress");
+ device_printf(dev, "unregister: operation in progress\n");
+ snd_mtxunlock(d->lock);
+ return EBUSY;
+ }
+ if (sndstat_busy() != 0) {
+ device_printf(dev, "unregister: sndstat busy\n");
snd_mtxunlock(d->lock);
return EBUSY;
}
SLIST_FOREACH(sce, &d->channels, link) {
if (sce->channel->refcount > 0) {
- device_printf(dev, "unregister: channel busy");
+ device_printf(dev, "unregister: channel busy\n");
snd_mtxunlock(d->lock);
return EBUSY;
}
}
if (mixer_uninit(dev)) {
- device_printf(dev, "unregister: mixer busy");
+ device_printf(dev, "unregister: mixer busy\n");
snd_mtxunlock(d->lock);
return EBUSY;
}
OpenPOWER on IntegriCloud