]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:38 +0000 (16:43 +0100)
commitdc4e25f8f60c2fb56e5f77dde46e4dabc3354d23
tree17b76674458f7d184f27a7ae804755e0993a57c3
parent724c114101b55889881593d124e73a8e115ad0e1
ACPICA: nsrepair: handle cases without a return value correctly

[ Upstream commit ca843a4c79486e99a19b859ef0b9887854afe146 ]

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: aa966edd09fd ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/acpica/nsrepair.c