diff options
| author | David Vrabel <david.vrabel@csr.com> | 2008-12-08 11:18:47 -0500 |
|---|---|---|
| committer | David Vrabel <david.vrabel@csr.com> | 2008-12-08 11:18:47 -0500 |
| commit | c35fa3ea1ae8198bd65c2c6e59d9ebd68c115a59 (patch) | |
| tree | 878768b69df25459b448aa890352342c4a3c6e2d /drivers/acpi/utils.c | |
| parent | dcc7461eef7341e84e2f7274f904ce01a43b2506 (diff) | |
| parent | 218d11a8b071b23b76c484fd5f72a4fe3306801e (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
Diffstat (limited to 'drivers/acpi/utils.c')
| -rw-r--r-- | drivers/acpi/utils.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e827be36ee8d..f844941089bb 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
| @@ -259,34 +259,26 @@ acpi_evaluate_integer(acpi_handle handle, | |||
| 259 | struct acpi_object_list *arguments, unsigned long long *data) | 259 | struct acpi_object_list *arguments, unsigned long long *data) |
| 260 | { | 260 | { |
| 261 | acpi_status status = AE_OK; | 261 | acpi_status status = AE_OK; |
| 262 | union acpi_object *element; | 262 | union acpi_object element; |
| 263 | struct acpi_buffer buffer = { 0, NULL }; | 263 | struct acpi_buffer buffer = { 0, NULL }; |
| 264 | 264 | ||
| 265 | |||
| 266 | if (!data) | 265 | if (!data) |
| 267 | return AE_BAD_PARAMETER; | 266 | return AE_BAD_PARAMETER; |
| 268 | 267 | ||
| 269 | element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL); | ||
| 270 | if (!element) | ||
| 271 | return AE_NO_MEMORY; | ||
| 272 | |||
| 273 | buffer.length = sizeof(union acpi_object); | 268 | buffer.length = sizeof(union acpi_object); |
| 274 | buffer.pointer = element; | 269 | buffer.pointer = &element; |
| 275 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); | 270 | status = acpi_evaluate_object(handle, pathname, arguments, &buffer); |
| 276 | if (ACPI_FAILURE(status)) { | 271 | if (ACPI_FAILURE(status)) { |
| 277 | acpi_util_eval_error(handle, pathname, status); | 272 | acpi_util_eval_error(handle, pathname, status); |
| 278 | kfree(element); | ||
| 279 | return status; | 273 | return status; |
| 280 | } | 274 | } |
| 281 | 275 | ||
| 282 | if (element->type != ACPI_TYPE_INTEGER) { | 276 | if (element.type != ACPI_TYPE_INTEGER) { |
| 283 | acpi_util_eval_error(handle, pathname, AE_BAD_DATA); | 277 | acpi_util_eval_error(handle, pathname, AE_BAD_DATA); |
| 284 | kfree(element); | ||
| 285 | return AE_BAD_DATA; | 278 | return AE_BAD_DATA; |
| 286 | } | 279 | } |
| 287 | 280 | ||
| 288 | *data = element->integer.value; | 281 | *data = element.integer.value; |
| 289 | kfree(element); | ||
| 290 | 282 | ||
| 291 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); | 283 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); |
| 292 | 284 | ||
