]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/utilities/utstate.c
Pull esi-support into release branch
[linux-2.6-omap-h63xx.git] / drivers / acpi / utilities / utstate.c
index 0f5c5bb5deff29dd1e53a23153a8fa03f81055d5..eaa13d05c859cd0ec20ba6543984ada6da747ff3 100644 (file)
@@ -199,6 +199,13 @@ struct acpi_thread_state *acpi_ut_create_thread_state(void)
        state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD;
        state->thread.thread_id = acpi_os_get_thread_id();
 
+       /* Check for invalid thread ID - zero is very bad, it will break things */
+
+       if (!state->thread.thread_id) {
+               ACPI_ERROR((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId"));
+               state->thread.thread_id = (acpi_thread_id) 1;
+       }
+
        return_PTR((struct acpi_thread_state *)state);
 }