git: f594f06fa983 - stable/15 - acpi_cpu(4): Call ACPI_GET_FEATURES() on a reset 'features' variable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Jul 2026 04:35:14 UTC
The branch stable/15 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=f594f06fa98351e115544546afb992af9140b014
commit f594f06fa98351e115544546afb992af9140b014
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-07-07 13:34:21 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-07-24 04:33:39 +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 51a7e513f649..7216acc5571d 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;
}