summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-06-19 00:25:03 +0000
committerwollman <wollman@FreeBSD.org>1997-06-19 00:25:03 +0000
commit016c0a5f2127ee2908d0a722fc8b3c431a982dc3 (patch)
tree6971b4a3c0acfbb7e2c72ded9b8ba82ce425fa3c /sys
parent8c2215a2080de8c3aedb41110271d5a27bd2ec7b (diff)
downloadFreeBSD-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')
-rw-r--r--sys/i386/apm/apm.c4
-rw-r--r--sys/i386/bios/apm.c4
2 files changed, 6 insertions, 2 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;
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 <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;
OpenPOWER on IntegriCloud