[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 11/16] acpi/ghes: don't crash QEMU if ghes GED is not found
From: |
Mauro Carvalho Chehab |
Subject: |
[PATCH v7 11/16] acpi/ghes: don't crash QEMU if ghes GED is not found |
Date: |
Wed, 15 Jan 2025 13:50:27 +0100 |
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>
---
hw/acpi/ghes.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
index 66bd98337ac7..6843ddf64b29 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);
--
2.47.1
- [PATCH v7 04/16] acpi/ghes: better handle source_id and notification, (continued)
- [PATCH v7 04/16] acpi/ghes: better handle source_id and notification, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 06/16] acpi/ghes: Remove a duplicated out of bounds check, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 15/16] acpi/ghes: Change ghes fill logic to work with only one source, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 08/16] acpi/ghes: don't check if physical_address is not zero, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 02/16] acpi/ghes: simplify acpi_ghes_record_errors() code, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 12/16] acpi/ghes: rename etc/hardware_error file macros, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 05/16] acpi/ghes: Fix acpi_ghes_record_errors() argument, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 07/16] acpi/ghes: Change the type for source_id, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 16/16] docs: acpi_hest_ghes: fix documentation for CPER size, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 14/16] acpi/ghes: move offset calculus to a separate function, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 11/16] acpi/ghes: don't crash QEMU if ghes GED is not found,
Mauro Carvalho Chehab <=
- [PATCH v7 10/16] acpi/ghes: better name GHES memory error function, Mauro Carvalho Chehab, 2025/01/15
- [PATCH v7 09/16] acpi/ghes: make the GHES record generation more generic, Mauro Carvalho Chehab, 2025/01/15