summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/vchan.c
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2001-06-26 21:54:55 +0000
committercg <cg@FreeBSD.org>2001-06-26 21:54:55 +0000
commit773e1607789dcccaee7122556d14d6d3698355ca (patch)
tree531c0ff9e1974120e044731d59a54c9ea255ac2a /sys/dev/sound/pcm/vchan.c
parentaa831c7a7bf3742803e44b67cc2a0fb4aa3e26f8 (diff)
downloadFreeBSD-src-773e1607789dcccaee7122556d14d6d3698355ca.zip
FreeBSD-src-773e1607789dcccaee7122556d14d6d3698355ca.tar.gz
add a tunable/sysctl, hw.snd.autovchans. if this is set to a value n where
n > 0, n vchans will be assigned to any devices that subsequently register with a single playback channel.
Diffstat (limited to 'sys/dev/sound/pcm/vchan.c')
-rw-r--r--sys/dev/sound/pcm/vchan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
index 3866ece..25e48c1 100644
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -348,6 +348,11 @@ sysctl_hw_snd_vchans(SYSCTL_HANDLER_ARGS)
err = sysctl_handle_int(oidp, &newcnt, sizeof(newcnt), req);
if (err == 0 && req->newptr != NULL) {
+ if (newcnt < 0 || newcnt > SND_MAXVCHANS) {
+ snd_mtxunlock(d->lock);
+ return EINVAL;
+ }
+
if (newcnt > cnt) {
/* add new vchans - find a parent channel first */
SLIST_FOREACH(sce, &d->channels, link) {
OpenPOWER on IntegriCloud