diff options
author | Dan Carpenter <error27@gmail.com> | 2009-12-11 02:31:40 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-15 17:29:37 -0500 |
commit | fbc3be2af3e8beb581a20c2a0cfda5692f5a1c08 (patch) | |
tree | 24506f062acad2f1144b74abf801cb4ca57bcc7b /drivers | |
parent | d4085a3ffee8828f7f1bae7fa3cf5e58f59ba627 (diff) |
ACPICA: Move check for valid Thread ID structure
This change moves the check for a valid Thread ID structure up a
few lines to insure that the check is made before the structure
is actually used.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/acpica/exmutex.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c index 2f0114202b05..3c456bd575d0 100644 --- a/drivers/acpi/acpica/exmutex.c +++ b/drivers/acpi/acpica/exmutex.c | |||
@@ -375,6 +375,15 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
375 | return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED); | 375 | return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED); |
376 | } | 376 | } |
377 | 377 | ||
378 | /* Must have a valid thread ID */ | ||
379 | |||
380 | if (!walk_state->thread) { | ||
381 | ACPI_ERROR((AE_INFO, | ||
382 | "Cannot release Mutex [%4.4s], null thread info", | ||
383 | acpi_ut_get_node_name(obj_desc->mutex.node))); | ||
384 | return_ACPI_STATUS(AE_AML_INTERNAL); | ||
385 | } | ||
386 | |||
378 | /* | 387 | /* |
379 | * The Mutex is owned, but this thread must be the owner. | 388 | * The Mutex is owned, but this thread must be the owner. |
380 | * Special case for Global Lock, any thread can release | 389 | * Special case for Global Lock, any thread can release |
@@ -392,15 +401,6 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc, | |||
392 | return_ACPI_STATUS(AE_AML_NOT_OWNER); | 401 | return_ACPI_STATUS(AE_AML_NOT_OWNER); |
393 | } | 402 | } |
394 | 403 | ||
395 | /* Must have a valid thread ID */ | ||
396 | |||
397 | if (!walk_state->thread) { | ||
398 | ACPI_ERROR((AE_INFO, | ||
399 | "Cannot release Mutex [%4.4s], null thread info", | ||
400 | acpi_ut_get_node_name(obj_desc->mutex.node))); | ||
401 | return_ACPI_STATUS(AE_AML_INTERNAL); | ||
402 | } | ||
403 | |||
404 | /* | 404 | /* |
405 | * The sync level of the mutex must be equal to the current sync level. In | 405 | * The sync level of the mutex must be equal to the current sync level. In |
406 | * other words, the current level means that at least one mutex at that | 406 | * other words, the current level means that at least one mutex at that |