It may be be worth re-writing the check as follows to avoid underflow
wrap:

if (walk_state->num_operands < 1 || walk_state->num_operands >= 
ARRAY_SIZE(walk_state->operands) + 1) {
   ACPI_ERROR((AE_INFO, "Illegal number of operands 0x%X for op_type 0x%X", 
walk_state->num_operands - 1, op_type));
   status = AE_AML_BAD_OPCODE;
   goto cleanup;
}

Note: if a fix is sent upstream they will nack-it on the ARRAY_SIZE()
macro because the ACPCIA core does not support this macro and the code
is derived from that code base. I've added notes to the upstream ACPICA
bug report so that it will get fixed using their coding standards.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1942215

Title:
  OOPs on boot: invalid opcode: 0000 [#1] SMP NOPTI

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1942215/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to