aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2026-07-07 13:34:21 +0000
committerOlivier Certner <olce@FreeBSD.org>2026-07-15 21:26:47 +0000
commit664ad9ac4c9047d29d5f37d43174e1b469e2ec80 (patch)
treeeaa24d88c53a3015569f4c209c3ac54fa976c5b6
parentfed49793ddd197e3dd86c8456b39f569ab74b54c (diff)
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
-rw-r--r--sys/dev/acpica/acpi_cpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index d2358f7077e5..48f6a27c1e89 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -313,7 +313,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];
@@ -417,6 +416,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;
}