diff options
author | wollman <wollman@FreeBSD.org> | 1997-06-19 00:25:03 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-06-19 00:25:03 +0000 |
commit | 016c0a5f2127ee2908d0a722fc8b3c431a982dc3 (patch) | |
tree | 6971b4a3c0acfbb7e2c72ded9b8ba82ce425fa3c /sys/i386/apm | |
parent | 8c2215a2080de8c3aedb41110271d5a27bd2ec7b (diff) | |
download | FreeBSD-src-016c0a5f2127ee2908d0a722fc8b3c431a982dc3.zip FreeBSD-src-016c0a5f2127ee2908d0a722fc8b3c431a982dc3.tar.gz |
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.)
Diffstat (limited to 'sys/i386/apm')
-rw-r--r-- | sys/i386/apm/apm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 3810c18..d2cc5b8 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/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 <sys/param.h> @@ -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; |