X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Facpi%2Futilities%2Futstate.c;h=63a6d3d77d88fc0c4e9de3105904a2a4302c278c;hb=ae9111912500db9fcc244ec16c3d7e471c551f52;hp=0f5c5bb5deff29dd1e53a23153a8fa03f81055d5;hpb=c0bc8721b8d0380ec69fa97578c91201201b05a9;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/utilities/utstate.c b/drivers/acpi/utilities/utstate.c index 0f5c5bb5def..63a6d3d77d8 100644 --- a/drivers/acpi/utilities/utstate.c +++ b/drivers/acpi/utilities/utstate.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2006, R. Byron Moore + * Copyright (C) 2000 - 2008, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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); }