Skip to content

Commit 311942c

Browse files
Shang song (Lenovo)rafaeljw
authored andcommitted
ACPI: PRM: Skip handlers with NULL handler_address or NULL VA
If handler_address or mapped VA is NULL, the related buffer address and VA can be ignored, so make acpi_parse_prmt() skip the current handler in those cases. Signed-off-by: Shang song (Lenovo) <shangsong2@foxmail.com> Link: https://patch.msgid.link/20250826030229.834901-1-shangsong2@foxmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent b320789 commit 311942c

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

drivers/acpi/prmt.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,28 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end)
150150
th = &tm->handlers[cur_handler];
151151

152152
guid_copy(&th->guid, (guid_t *)handler_info->handler_guid);
153+
154+
/*
155+
* Print an error message if handler_address is NULL, the parse of VA also
156+
* can be skipped.
157+
*/
158+
if (unlikely(!handler_info->handler_address)) {
159+
pr_info("Skipping handler with NULL address for GUID: %pUL",
160+
(guid_t *)handler_info->handler_guid);
161+
continue;
162+
}
163+
153164
th->handler_addr =
154165
(void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
155166
/*
156-
* Print a warning message if handler_addr is zero which is not expected to
157-
* ever happen.
167+
* Print a warning message and skip the parse of VA if handler_addr is zero
168+
* which is not expected to ever happen.
158169
*/
159-
if (unlikely(!th->handler_addr))
170+
if (unlikely(!th->handler_addr)) {
160171
pr_warn("Failed to find VA of handler for GUID: %pUL, PA: 0x%llx",
161172
&th->guid, handler_info->handler_address);
173+
continue;
174+
}
162175

163176
th->static_data_buffer_addr =
164177
efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address);

0 commit comments

Comments
 (0)