Skip to content

Commit b3381bd

Browse files
acpibobrafaeljw
authored andcommitted
ACPICA: Interpreter: Emit warning for creation of a zero-length op region
ACPICA commit 387c850c5d49d09d7c2e70b2711e584ad83956a1 Nothing can be done with such a region. Just emit a warning so as not to abort a table load or running method. Link: acpica/acpica@387c850c Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent aa34226 commit b3381bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/acpi/acpica/dsopcode.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
356356
union acpi_operand_object *operand_desc;
357357
struct acpi_namespace_node *node;
358358
union acpi_parse_object *next_op;
359+
acpi_adr_space_type space_id;
359360

360361
ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op);
361362

@@ -368,6 +369,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
368369
/* next_op points to the op that holds the space_ID */
369370

370371
next_op = op->common.value.arg;
372+
space_id = (acpi_adr_space_type)next_op->common.value.integer;
371373

372374
/* next_op points to address op */
373375

@@ -403,6 +405,15 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
403405
obj_desc->region.length = (u32) operand_desc->integer.value;
404406
acpi_ut_remove_reference(operand_desc);
405407

408+
/* A zero-length operation region is unusable. Just warn */
409+
410+
if (!obj_desc->region.length
411+
&& (space_id < ACPI_NUM_PREDEFINED_REGIONS)) {
412+
ACPI_WARNING((AE_INFO,
413+
"Operation Region [%4.4s] has zero length (SpaceId %X)",
414+
node->name.ascii, space_id));
415+
}
416+
406417
/*
407418
* Get the address and save it
408419
* (at top of stack - 1)

0 commit comments

Comments
 (0)