diff options
author | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2024-08-20 07:44:37 +0000 |
---|---|---|
committer | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2024-08-20 07:44:37 +0000 |
commit | 8e6e36c5067aa2399c184ae4bcab8bc036c31d75 (patch) | |
tree | 80fa5165650e1964821e3016d3d80edbc3da89d1 /sys/kern | |
parent | 8f592944cb7666c3994b0f325245bc73c0d70633 (diff) |
Unlock sysctl_audio().
It is the only KERN_AUDIO_RECORD. `audio_record_enable' is atomically
accessed integer.
Reasonable from deraadt
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 99c8181f720..8b10fd14208 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.439 2024/08/14 17:52:47 mvs Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.440 2024/08/20 07:44:36 mvs Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -455,11 +455,6 @@ kern_sysctl_dirs(int top_name, int *name, u_int namelen, return witness_sysctl(name, namelen, oldp, oldlenp, newp, newlen); #endif -#if NAUDIO > 0 - case KERN_AUDIO: - return (sysctl_audio(name, namelen, oldp, oldlenp, - newp, newlen)); -#endif #if NVIDEO > 0 case KERN_VIDEO: return (sysctl_video(name, namelen, oldp, oldlenp, @@ -488,6 +483,16 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, /* dispatch the non-terminal nodes first */ if (namelen != 1) { + switch (name[0]) { +#if NAUDIO > 0 + case KERN_AUDIO: + return (sysctl_audio(name, namelen, oldp, oldlenp, + newp, newlen)); +#endif + default: + break; + } + savelen = *oldlenp; if ((error = sysctl_vslock(oldp, savelen))) return (error); |