Skip to content

Commit 1acc8d4

Browse files
mchehabmstsirkin
authored andcommitted
acpi/ghes: don't crash QEMU if ghes GED is not found
Make error handling within ghes_record_cper_errors() consistent, i.e. instead abort just print a error in case ghes GED is not found. Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Igor Mammedov <[email protected]> Message-Id: <c7e1665ba46df321f0ce161d60dfd681ab827535.1736945236.git.mchehab+huawei@kernel.org> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent d32028a commit 1acc8d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hw/acpi/ghes.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@ void ghes_record_cper_errors(const void *cper, size_t len,
371371

372372
acpi_ged_state = ACPI_GED(object_resolve_path_type("", TYPE_ACPI_GED,
373373
NULL));
374-
g_assert(acpi_ged_state);
374+
if (!acpi_ged_state) {
375+
error_setg(errp, "Can't find ACPI_GED object");
376+
return;
377+
}
375378
ags = &acpi_ged_state->ghes_state;
376379

377380
start_addr = le64_to_cpu(ags->ghes_addr_le);

0 commit comments

Comments
 (0)