diff options
-rw-r--r-- | drivers/acpi/acpica/utobject.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index aa61f66ee861..cddb0ef5b9b7 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c | |||
@@ -461,25 +461,28 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, | |||
461 | 461 | ||
462 | ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object); | 462 | ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object); |
463 | 463 | ||
464 | /* Start with the length of the (external) Acpi object */ | ||
465 | |||
466 | length = sizeof(union acpi_object); | ||
467 | |||
468 | /* A NULL object is allowed, can be a legal uninitialized package element */ | ||
469 | |||
470 | if (!internal_object) { | ||
464 | /* | 471 | /* |
465 | * Handle a null object (Could be a uninitialized package | 472 | * Object is NULL, just return the length of union acpi_object |
466 | * element -- which is legal) | 473 | * (A NULL union acpi_object is an object of all zeroes.) |
467 | */ | 474 | */ |
468 | if (!internal_object) { | 475 | *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length); |
469 | *obj_length = sizeof(union acpi_object); | ||
470 | return_ACPI_STATUS(AE_OK); | 476 | return_ACPI_STATUS(AE_OK); |
471 | } | 477 | } |
472 | 478 | ||
473 | /* Start with the length of the Acpi object */ | 479 | /* A Namespace Node should never appear here */ |
474 | |||
475 | length = sizeof(union acpi_object); | ||
476 | 480 | ||
477 | if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) { | 481 | if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) { |
478 | 482 | ||
479 | /* Object is a named object (reference), just return the length */ | 483 | /* A namespace node should never get here */ |
480 | 484 | ||
481 | *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length); | 485 | return_ACPI_STATUS(AE_AML_INTERNAL); |
482 | return_ACPI_STATUS(status); | ||
483 | } | 486 | } |
484 | 487 | ||
485 | /* | 488 | /* |