ACPI: extlog: Fix finding the generic error data for v3 structure
authorXiaochun Lee <lixc17@lenovo.com>
Wed, 2 Aug 2023 13:47:46 +0000 (21:47 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 17 Aug 2023 17:44:22 +0000 (19:44 +0200)
Fix by using acpi_hest_get_payload() to find out the correct
generic error data for v3 structure.

The revision v300 generic error data is different from the old one, so
for compatibility with old and new version, change to a new interface to
locate the right memory error section that was defined in CPER.

Signed-off-by: Xiaochun Lee <lixc17@lenovo.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_extlog.c

index e648158368a7d8802f129e6da1509fa054f8af71..e120a96e1eaee803c5beb0741072471de98a7bcf 100644 (file)
@@ -172,7 +172,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
                        fru_text = "";
                sec_type = (guid_t *)gdata->section_type;
                if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
-                       struct cper_sec_mem_err *mem = (void *)(gdata + 1);
+                       struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata);
 
                        if (gdata->error_data_length >= sizeof(*mem))
                                trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,