Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Fix fix of a bug: first initialize sc, check sc...
details: https://anonhg.NetBSD.org/src/rev/595314f72182
branches: trunk
changeset: 757182:595314f72182
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Aug 18 02:01:45 2010 +0000
description:
Fix fix of a bug: first initialize sc, check sc != NULL, then KASSERT(9).
diffstat:
sys/dev/acpi/acpi_cpu_cstate.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r df9bbfe3bf71 -r 595314f72182 sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c Wed Aug 18 01:56:45 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c Wed Aug 18 02:01:45 2010 +0000
@@ -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@localhost>
@@ -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;
Home |
Main Index |
Thread Index |
Old Index