Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 Avoid fault if acpi_softc is NULL at at...
details: https://anonhg.NetBSD.org/src/rev/27fa619e2961
branches: trunk
changeset: 757777:27fa619e2961
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Wed Sep 22 16:16:51 2010 +0000
description:
Avoid fault if acpi_softc is NULL at attempted power-off.
XXX at least some of this should be factored off into arch/x86.
diffstat:
sys/arch/amd64/amd64/machdep.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r 0a7bf06270cf -r 27fa619e2961 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c Wed Sep 22 14:37:08 2010 +0000
+++ b/sys/arch/amd64/amd64/machdep.c Wed Sep 22 16:16:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.148 2010/08/07 20:07:25 jruoho Exp $ */
+/* $NetBSD: machdep.c,v 1.149 2010/09/22 16:16:51 jakllsch Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.148 2010/08/07 20:07:25 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.149 2010/09/22 16:16:51 jakllsch Exp $");
/* #define XENDEBUG_LOW */
@@ -697,8 +697,10 @@
if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
#ifndef XEN
#if NACPICA > 0
- acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5);
- printf("WARNING: powerdown failed!\n");
+ if (acpi_softc != NULL) {
+ acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5);
+ printf("WARNING: ACPI powerdown failed!\n");
+ }
#endif
#else /* XEN */
HYPERVISOR_shutdown();
Home |
Main Index |
Thread Index |
Old Index