git: fc759cca5090 - stable/14 - acpi_cpu(4): Call ACPI_GET_FEATURES() on a reset 'features' variable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 23 Jul 2026 10:01:24 UTC
The branch stable/14 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=fc759cca5090840d1fc1fa3825f0dc32f28669ef
commit fc759cca5090840d1fc1fa3825f0dc32f28669ef
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-07-07 13:34:21 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-07-23 09:59:18 +0000
acpi_cpu(4): Call ACPI_GET_FEATURES() on a reset 'features' variable
This is to prevent child drivers from using the features returned by
previous drivers (in an arbitrary order). None of the existing ones do
that, so this is purely defensive.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 664ad9ac4c9047d29d5f37d43174e1b469e2ec80)
---
sys/dev/acpica/acpi_cpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 1ea045c4e812..7956ed6f8d43 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -311,7 +311,6 @@ acpi_cpu_attach(device_t dev)
struct acpi_cpu_softc *sc;
struct acpi_softc *acpi_sc;
ACPI_STATUS status;
- u_int features;
int cpu_id, drv_count, i;
driver_t **drivers;
uint32_t cap_set[3];
@@ -415,6 +414,8 @@ acpi_cpu_attach(device_t dev)
if (devclass_get_drivers(device_get_devclass(dev), &drivers,
&drv_count) == 0) {
for (i = 0; i < drv_count; i++) {
+ u_int features = 0;
+
if (ACPI_GET_FEATURES(drivers[i], &features) == 0)
sc->cpu_features |= features;
}