Date: Mon, 27 Oct 2025 18:27:00 GMT From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 34dfccc64f47 - main - acpi: in acpi_stype_sysctl() use same logic as in acpi_sleep_state_sysctl() Message-ID: <202510271827.59RIR0mG027010@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=34dfccc64f47f1549e65593b4a3aa8d31757529d commit 34dfccc64f47f1549e65593b4a3aa8d31757529d Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2025-10-27 18:22:46 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-10-27 18:26:32 +0000 acpi: in acpi_stype_sysctl() use same logic as in acpi_sleep_state_sysctl() Otherwise we allow to trigger an MPASS() by a userland sysctl, e.g. hw.acpi.power_button_state=NONE. This does not bring fully compatibility, where as before 97d152698f483 setting to 'NONE' actually meant disabling any action on a power or sleep button. Now sysctl will fail, but with this change it won't at least panic. Aymeric may come with a better fix. Fixes: 97d152698f4831db5a94d55c15233330c188feda --- sys/dev/acpica/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 3f0a7b40245d..e3ff4f6937d2 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -4430,8 +4430,8 @@ acpi_stype_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); printf("warning: this sysctl expects a sleep type, but an ACPI S-state has " "been passed to it. This functionality is deprecated; see acpi(4).\n"); - MPASS(sstate < ACPI_S_STATE_COUNT); - if (acpi_supported_sstates[sstate] == false) + if (sstate < ACPI_S_STATE_COUNT && + !acpi_supported_sstates[sstate]) return (EOPNOTSUPP); new_stype = acpi_sstate_to_stype(sstate); }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510271827.59RIR0mG027010>
