diff options
author | jkim <jkim@FreeBSD.org> | 2011-04-19 16:30:17 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-04-19 16:30:17 +0000 |
commit | cc6bebd7b6fa6e0e167807baca1a190b89f16203 (patch) | |
tree | e9f72c6844abbdb2f998065cb78695c25a0ce3a8 /sys/i386/bios | |
parent | 79542a929deff2bec2296c282a7961f5ee1b8cd6 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/i386/bios/apm.c | 10 |
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); |