From 02bba4e7ee76c099fc39be4e122761be22161f51 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sun, 15 Mar 2015 21:36:46 +0800 Subject: [PATCH] acpi/cstate: Clear saved C-state softc, if attach failed And install softc during the probe; instead of using (void *)1. --- sys/dev/acpica/acpi_cpu_cstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_cpu_cstate.c b/sys/dev/acpica/acpi_cpu_cstate.c index 63def14284..9883f942ad 100644 --- a/sys/dev/acpica/acpi_cpu_cstate.c +++ b/sys/dev/acpica/acpi_cpu_cstate.c @@ -228,7 +228,7 @@ acpi_cst_probe(device_t dev) } /* Mark this processor as in-use and save our derived id for attach. */ - acpi_cst_softc[cpu_id] = (void *)1; + acpi_cst_softc[cpu_id] = device_get_softc(dev); device_set_desc(dev, "ACPI CPU C-State"); return (0); @@ -259,6 +259,7 @@ acpi_cst_attach(device_t dev) if (ACPI_FAILURE(status)) { device_printf(dev, "attach failed to get Processor obj - %s\n", AcpiFormatException(status)); + acpi_cst_softc[sc->cst_cpuid] = NULL; return (ENXIO); } obj = (ACPI_OBJECT *)buf.Pointer; -- 2.41.0