Module Name: src
Committed By: jruoho
Date: Wed Aug 18 02:01:45 UTC 2010
Modified Files:
src/sys/dev/acpi: acpi_cpu_cstate.c
Log Message:
Fix fix of a bug: first initialize sc, check sc != NULL, then KASSERT(9).
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/acpi/acpi_cpu_cstate.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/acpi/acpi_cpu_cstate.c
diff -u src/sys/dev/acpi/acpi_cpu_cstate.c:1.30 src/sys/dev/acpi/acpi_cpu_cstate.c:1.31
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.30 Tue Aug 17 18:49:28 2010
+++ src/sys/dev/acpi/acpi_cpu_cstate.c Wed Aug 18 02:01:45 2010
@@ -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 <[email protected]>
@@ -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 @@
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;