Skip to content

Commit

Permalink
ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value
Browse files Browse the repository at this point in the history
The return value of acpi_fetch_acpi_dev() could be NULL, which would
cause a NULL pointer dereference to occur in acpi_device_hid().

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
[ rjw: Subject and changelog edits, added empty line after if () ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Li Zhong authored and Rafael J. Wysocki committed Oct 28, 2022
1 parent 247f34f commit 2437513
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr)
status = acpi_get_parent(handle, &pr_ahandle);
while (ACPI_SUCCESS(status)) {
d = acpi_fetch_acpi_dev(pr_ahandle);
if (!d)
break;

handle = pr_ahandle;

if (strcmp(acpi_device_hid(d), ACPI_PROCESSOR_CONTAINER_HID))
Expand Down

0 comments on commit 2437513

Please sign in to comment.