ghes_do_proc() initializes the FRU ID and text only once before walking
all sections in an error status block. A section without FRU validation
bits therefore inherits metadata from an earlier section and reports the
wrong FRU through the non-standard event tracepoint.

Reset both values at the start of every section before applying the
validation bits from the current section.

Fixes: 297b64c74385 ("ras: acpi / apei: generate trace event for unrecognized 
CPER section")
Reported-by: [email protected]
Link: 
https://sashiko.dev/#/message/20260708144441.6E1181F000E9%40smtp.kernel.org
Signed-off-by: Ahmed Tiba <[email protected]>
---
 drivers/acpi/apei/ghes.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 94f539f5d676..84a8b7ee911f 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -998,6 +998,9 @@ static void ghes_do_proc(struct ghes *ghes,
        apei_estatus_for_each_section(estatus, gdata) {
                sec_type = (guid_t *)gdata->section_type;
                sec_sev = ghes_severity(gdata->error_severity);
+               fru_id = &guid_null;
+               fru_text = "";
+
                if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
                        fru_id = (guid_t *)gdata->fru_id;
 

-- 
2.43.0


Reply via email to