commit 5df85bbf9a02f5bd116bc8520aba2d6b4ee1b2fb
Author: Taku YAMAMOTO <taku@tackymt.homeip.net>
Date:   Thu Feb 14 01:07:22 2013 +0900

    Fix GPE handling on sleeping. (found on X61)

diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index da252c4..2ccf08a 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2905,6 +2905,8 @@ acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate)
     if (acpi_parse_prw(handle, &prw) != 0)
 	return (ENXIO);
     dev = acpi_get_device(handle);
+    if (dev == NULL || (acpi_get_flags(dev) & ACPI_FLAG_WAKE_ENABLED) == 0)
+	return (0);
 
     /*
      * The destination sleep state must be less than (i.e., higher power)
@@ -2918,7 +2920,7 @@ acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate)
 	if (bootverbose)
 	    device_printf(dev, "wake_prep disabled wake for %s (S%d)\n",
 		acpi_name(handle), sstate);
-    } else if (dev && (acpi_get_flags(dev) & ACPI_FLAG_WAKE_ENABLED) != 0) {
+    } else {
 	acpi_pwr_wake_enable(handle, 1);
 	acpi_SetInteger(handle, "_PSW", 1);
 	if (bootverbose)
