summaryrefslogtreecommitdiffstats
path: root/sys/i386/bios/apm.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2011-04-19 16:30:17 +0000
committerjkim <jkim@FreeBSD.org>2011-04-19 16:30:17 +0000
commitcc6bebd7b6fa6e0e167807baca1a190b89f16203 (patch)
treee9f72c6844abbdb2f998065cb78695c25a0ce3a8 /sys/i386/bios/apm.c
parent79542a929deff2bec2296c282a7961f5ee1b8cd6 (diff)
downloadFreeBSD-src-cc6bebd7b6fa6e0e167807baca1a190b89f16203.zip
FreeBSD-src-cc6bebd7b6fa6e0e167807baca1a190b89f16203.tar.gz
Do not invoke resume event handlers if suspend was successful.
Pointy hat to: jkim
Diffstat (limited to 'sys/i386/bios/apm.c')
-rw-r--r--sys/i386/bios/apm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c
index 1fe2e86..bf5071f 100644
--- a/sys/i386/bios/apm.c
+++ b/sys/i386/bios/apm.c
@@ -499,11 +499,13 @@ apm_do_suspend(void)
if (apm_suspend_system(PMST_SUSPEND) == 0) {
sc->suspending = 1;
apm_processevent();
- } else {
- /* Failure, 'resume' the system again */
- apm_execute_hook(hook[APM_HOOK_RESUME]);
- DEVICE_RESUME(root_bus);
+ mtx_unlock(&Giant);
+ return;
}
+
+ /* Failure, 'resume' the system again */
+ apm_execute_hook(hook[APM_HOOK_RESUME]);
+ DEVICE_RESUME(root_bus);
backout:
mtx_unlock(&Giant);
EVENTHANDLER_INVOKE(power_resume);
OpenPOWER on IntegriCloud