aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/utilities/utobject.c')
-rw-r--r--drivers/acpi/utilities/utobject.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index e25484495e65..c354e7a42bcd 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
46#include <acpi/amlcode.h>
47 46
48#define _COMPONENT ACPI_UTILITIES 47#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utobject") 48ACPI_MODULE_NAME("utobject")
@@ -425,6 +424,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
425 acpi_size * obj_length) 424 acpi_size * obj_length)
426{ 425{
427 acpi_size length; 426 acpi_size length;
427 acpi_size size;
428 acpi_status status = AE_OK; 428 acpi_status status = AE_OK;
429 429
430 ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object); 430 ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object);
@@ -477,17 +477,21 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
477 477
478 case ACPI_TYPE_LOCAL_REFERENCE: 478 case ACPI_TYPE_LOCAL_REFERENCE:
479 479
480 switch (internal_object->reference.opcode) { 480 switch (internal_object->reference.class) {
481 case AML_INT_NAMEPATH_OP: 481 case ACPI_REFCLASS_NAME:
482 482
483 /* 483 /*
484 * Get the actual length of the full pathname to this object. 484 * Get the actual length of the full pathname to this object.
485 * The reference will be converted to the pathname to the object 485 * The reference will be converted to the pathname to the object
486 */ 486 */
487 length += 487 size =
488 ACPI_ROUND_UP_TO_NATIVE_WORD 488 acpi_ns_get_pathname_length(internal_object->
489 (acpi_ns_get_pathname_length 489 reference.node);
490 (internal_object->reference.node)); 490 if (!size) {
491 return_ACPI_STATUS(AE_BAD_PARAMETER);
492 }
493
494 length += ACPI_ROUND_UP_TO_NATIVE_WORD(size);
491 break; 495 break;
492 496
493 default: 497 default:
@@ -498,8 +502,10 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
498 * required eventually. 502 * required eventually.
499 */ 503 */
500 ACPI_ERROR((AE_INFO, 504 ACPI_ERROR((AE_INFO,
501 "Unsupported Reference opcode=%X in object %p", 505 "Cannot convert to external object - "
502 internal_object->reference.opcode, 506 "unsupported Reference Class [%s] %X in object %p",
507 acpi_ut_get_reference_name(internal_object),
508 internal_object->reference.class,
503 internal_object)); 509 internal_object));
504 status = AE_TYPE; 510 status = AE_TYPE;
505 break; 511 break;
@@ -508,7 +514,9 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
508 514
509 default: 515 default:
510 516
511 ACPI_ERROR((AE_INFO, "Unsupported type=%X in object %p", 517 ACPI_ERROR((AE_INFO, "Cannot convert to external object - "
518 "unsupported type [%s] %X in object %p",
519 acpi_ut_get_object_type_name(internal_object),
512 ACPI_GET_OBJECT_TYPE(internal_object), 520 ACPI_GET_OBJECT_TYPE(internal_object),
513 internal_object)); 521 internal_object));
514 status = AE_TYPE; 522 status = AE_TYPE;