stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.4.y] ACPI: processor: idle: Check acpi_bus_get_device return value
@ 2025-08-19 13:06 Yann Sionneau
  0 siblings, 0 replies; only message in thread
From: Yann Sionneau @ 2025-08-19 13:06 UTC (permalink / raw)
  To: stable
  Cc: Greg KH, Li Zhong, Rafael J . Wysocki, Teddy Astie, Yann Sionneau,
	Dillon C

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-a2-7945hx

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
-- 
2.43.0



Yann Sionneau | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-19 13:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 13:06 [PATCH 5.4.y] ACPI: processor: idle: Check acpi_bus_get_device return value Yann Sionneau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).