diff options
| author | jruoho <jruoho@NetBSD.org> | 2010-08-18 02:01:45 +0000 |
|---|---|---|
| committer | jruoho <jruoho@NetBSD.org> | 2010-08-18 02:01:45 +0000 |
| commit | 46457f068f8ea83e51d8fa49e522fe97d7a922d6 (patch) | |
| tree | 868eb3f032207af24e2fca2e986d35e3191475bf /sys/dev | |
| parent | c6f8bef851970fa1277981bd8a5c11f0c5205e3e (diff) | |
Fix fix of a bug: first initialize sc, check sc != NULL, then KASSERT(9).
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/acpi_cpu_cstate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpi_cpu_cstate.c b/sys/dev/acpi/acpi_cpu_cstate.c index 4f15414d74a..43120f44d16 100644 --- a/sys/dev/acpi/acpi_cpu_cstate.c +++ b/sys/dev/acpi/acpi_cpu_cstate.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_cstate.c,v 1.30 2010/08/17 18:49:28 cegger Exp $ */ +/* $NetBSD: acpi_cpu_cstate.c,v 1.31 2010/08/18 02:01:45 jruoho Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.30 2010/08/17 18:49:28 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.31 2010/08/18 02:01:45 jruoho Exp $"); #include <sys/param.h> #include <sys/cpu.h> @@ -664,14 +664,15 @@ acpicpu_cstate_idle(void) KASSERT(acpicpu_sc != NULL); KASSERT(ci->ci_acpiid < maxcpus); - KASSERT(ci->ci_ilevel == IPL_NONE); sc = acpicpu_sc[ci->ci_acpiid]; - KASSERT((sc->sc_flags & ACPICPU_FLAG_C) != 0); if (__predict_false(sc == NULL)) goto halt; + KASSERT(ci->ci_ilevel == IPL_NONE); + KASSERT((sc->sc_flags & ACPICPU_FLAG_C) != 0); + if (__predict_false(sc->sc_cold != false)) goto halt; |
