From: Teddy Astie teddy.astie@vates.tech
[ Upstream commit 2437513a814b3e93bd02879740a8a06e52e2cf7d ]
Fix a potential NULL pointer dereferences if acpi_bus_get_device happens to fail. This is backported from commit 2437513a814b3 ("ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value") This has been tested successfully by the reporter, see https://xcp-ng.org/forum/topic/10972/xcp-ng-8.3-lts-install-on-minisforum-ms...
Signed-off-by: Li Zhong floridsleeves@gmail.com Signed-off-by: Teddy Astie teddy.astie@vates.tech Signed-off-by: Yann Sionneau yann.sionneau@vates.tech Reported-by: Dillon C dchan@dchan.tech Tested-by: Dillon C dchan@dchan.tech --- drivers/acpi/processor_idle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 92db8b0622b2..e6bba26caf3c 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1228,7 +1228,9 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr)
status = acpi_get_parent(handle, &pr_ahandle); while (ACPI_SUCCESS(status)) { - acpi_bus_get_device(pr_ahandle, &d); + if (acpi_bus_get_device(pr_ahandle, &d)) + break; + handle = pr_ahandle;
if (strcmp(acpi_device_hid(d), ACPI_PROCESSOR_CONTAINER_HID))
base-commit: 04b7726c3cdd2fb4da040c2b898bcf405ed607bd
linux-stable-mirror@lists.linaro.org