From 016c0a5f2127ee2908d0a722fc8b3c431a982dc3 Mon Sep 17 00:00:00 2001 From: wollman Date: Thu, 19 Jun 1997 00:25:03 +0000 Subject: Fix crash when halting where APM was configured but not enabled by checking whether APM is active in apm_power_off() and returning if not. (The code was already written with the expectation that this function would return if it fails.) --- sys/i386/bios/apm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/i386/bios') diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 3810c18..d2cc5b8 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -15,7 +15,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.57 1997/06/15 02:02:41 wollman Exp $ + * $Id: apm.c,v 1.58 1997/06/15 02:19:40 wollman Exp $ */ #include @@ -231,6 +231,8 @@ apm_power_off(void) { u_long eax, ebx, ecx; + if (!apm_softc.active) + return; eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_ALLDEV; ecx = PMST_OFF; -- cgit v1.1