diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2025-01-15 13:50:27 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2025-01-15 13:07:11 -0500 |
commit | 1acc8d4e647e3d9fc45cc43c216e784e47a74809 (patch) | |
tree | 160eca9802bd86c6503f86ac623da1369985e34a | |
parent | d32028a54000db671eb2d0b6b28bbf15acc2e5f9 (diff) | |
download | qemu-1acc8d4e647e3d9fc45cc43c216e784e47a74809.zip qemu-1acc8d4e647e3d9fc45cc43c216e784e47a74809.tar.gz qemu-1acc8d4e647e3d9fc45cc43c216e784e47a74809.tar.bz2 |
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 <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <c7e1665ba46df321f0ce161d60dfd681ab827535.1736945236.git.mchehab+huawei@kernel.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/acpi/ghes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 66bd983..6843ddf 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -371,7 +371,10 @@ void ghes_record_cper_errors(const void *cper, size_t len, acpi_ged_state = ACPI_GED(object_resolve_path_type("", TYPE_ACPI_GED, NULL)); - g_assert(acpi_ged_state); + if (!acpi_ged_state) { + error_setg(errp, "Can't find ACPI_GED object"); + return; + } ags = &acpi_ged_state->ghes_state; start_addr = le64_to_cpu(ags->ghes_addr_le); |