Skip to content

Commit 2437513

Browse files
FloridSleevesrafaeljw
authored andcommitted
ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value
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 <[email protected]> [ rjw: Subject and changelog edits, added empty line after if () ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 247f34f commit 2437513

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/acpi/processor_idle.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,9 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr)
11341134
status = acpi_get_parent(handle, &pr_ahandle);
11351135
while (ACPI_SUCCESS(status)) {
11361136
d = acpi_fetch_acpi_dev(pr_ahandle);
1137+
if (!d)
1138+
break;
1139+
11371140
handle = pr_ahandle;
11381141

11391142
if (strcmp(acpi_device_hid(d), ACPI_PROCESSOR_CONTAINER_HID))

0 commit comments

Comments
 (0)