From 8e6e36c5067aa2399c184ae4bcab8bc036c31d75 Mon Sep 17 00:00:00 2001 From: Vitaliy Makkoveev Date: Tue, 20 Aug 2024 07:44:37 +0000 Subject: Unlock sysctl_audio(). It is the only KERN_AUDIO_RECORD. `audio_record_enable' is atomically accessed integer. Reasonable from deraadt --- sys/kern/kern_sysctl.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sys/kern') 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); -- cgit v1.2.3