summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-09 17:59:38 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-09 17:59:38 +0000
commit6650083e2be67db32c2e72ab4c815a9f1111a5ba (patch)
treebe268b8ad401fff3253774600ee0489ba0cf5eb1 /sys/dev
parent14a0594e58f3b888a489de9cdd6b013530c44235 (diff)
make sure mixer was opened for write for AUDIO_MIXER_WRITE
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/audio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 28fff9ef192..219e1e89a7f 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.32 2001/11/06 19:53:18 miod Exp $ */
+/* $OpenBSD: audio.c,v 1.33 2002/01/09 17:59:37 mickey Exp $ */
/* $NetBSD: audio.c,v 1.105 1998/09/27 16:43:56 christos Exp $ */
/*
@@ -3014,6 +3014,8 @@ mixer_ioctl(dev, cmd, addr, flag, p)
break;
case AUDIO_MIXER_WRITE:
+ if (!(flag & FWRITE))
+ return (EACCES);
DPRINTF(("AUDIO_MIXER_WRITE\n"));
error = hw->set_port(sc->hw_hdl, (mixer_ctrl_t *)addr);
if (!error && hw->commit_settings)