From: Bob Moore Date: Thu, 8 Aug 2013 07:29:58 +0000 (+0800) Subject: ACPICA: Return error if DerefOf resolves to a null package element. X-Git-Tag: upstream/snapshot3+hdmi~4468^2~13^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a50abf4842dd7d603a2ad6dcc7f1467fd2a66f03;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ACPICA: Return error if DerefOf resolves to a null package element. Disallow the dereference of a reference (via index) to an uninitialized package element. Provides compatibility with other ACPI implementations. ACPICA BZ 1003. References: https://bugs.acpica.org/show_bug.cgi?id=431 Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c index 3482df4..2cdd41d 100644 --- a/drivers/acpi/acpica/exoparg1.c +++ b/drivers/acpi/acpica/exoparg1.c @@ -962,10 +962,17 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) */ return_desc = *(operand[0]->reference.where); - if (return_desc) { - acpi_ut_add_reference - (return_desc); + if (!return_desc) { + /* + * Element is NULL, do not allow the dereference. + * This provides compatibility with other ACPI + * implementations. + */ + return_ACPI_STATUS + (AE_AML_UNINITIALIZED_ELEMENT); } + + acpi_ut_add_reference(return_desc); break; default: