Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119346
b: refs/heads/master
c: 4059907
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Machek authored and Len Brown committed Nov 26, 2008
1 parent a901f47 commit b90f7e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 558073dd56707864f09d563b64e7c37c021e89d2
refs/heads/master: 40599072dca3ec7d4c9ff8271978be169f974638
16 changes: 4 additions & 12 deletions trunk/drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,34 +259,26 @@ acpi_evaluate_integer(acpi_handle handle,
struct acpi_object_list *arguments, unsigned long long *data)
{
acpi_status status = AE_OK;
union acpi_object *element;
union acpi_object element;
struct acpi_buffer buffer = { 0, NULL };


if (!data)
return AE_BAD_PARAMETER;

element = kzalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
if (!element)
return AE_NO_MEMORY;

buffer.length = sizeof(union acpi_object);
buffer.pointer = element;
buffer.pointer = &element;
status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
if (ACPI_FAILURE(status)) {
acpi_util_eval_error(handle, pathname, status);
kfree(element);
return status;
}

if (element->type != ACPI_TYPE_INTEGER) {
if (element.type != ACPI_TYPE_INTEGER) {
acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
kfree(element);
return AE_BAD_DATA;
}

*data = element->integer.value;
kfree(element);
*data = element.integer.value;

ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));

Expand Down

0 comments on commit b90f7e5

Please sign in to comment.