ACPICA: nsrepair: handle cases without a return value correctly
authorDaniil Tatianin <d-tatianin@yandex-team.ru>
Fri, 6 Jan 2023 23:53:08 +0000 (02:53 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 10 Jan 2023 19:19:05 +0000 (20:19 +0100)
commitca843a4c79486e99a19b859ef0b9887854afe146
tree907736bfc180b2e12d60c6b4b13e40e772380eac
parent91fdb91ccca2b48572a1ccf1d382fd599e3e1237
ACPICA: nsrepair: handle cases without a return value correctly

Previously acpi_ns_simple_repair() would crash if expected_btypes
contained any combination of ACPI_RTYPE_NONE with a different type,
e.g | ACPI_RTYPE_INTEGER because of slightly incorrect logic in the
!return_object branch, which wouldn't return AE_AML_NO_RETURN_VALUE
for such cases.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Link: https://github.com/acpica/acpica/pull/811
Fixes: 61db45ca2163 ("ACPICA: Restore code that repairs NULL package elements in return values.")
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/nsrepair.c