Commit 37d2a362 authored by Jiang Liu's avatar Jiang Liu Committed by Len Brown

CPER failed to handle generic error records with multiple sections

The function apei_estatus_print() and apei_estatus_check() forget to move ahead
the gdata pointer when dealing with multiple generic error data sections.
Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 15afae60
...@@ -362,6 +362,7 @@ void apei_estatus_print(const char *pfx, ...@@ -362,6 +362,7 @@ void apei_estatus_print(const char *pfx,
gedata_len = gdata->error_data_length; gedata_len = gdata->error_data_length;
apei_estatus_print_section(pfx, gdata, sec_no); apei_estatus_print_section(pfx, gdata, sec_no);
data_len -= gedata_len + sizeof(*gdata); data_len -= gedata_len + sizeof(*gdata);
gdata = (void *)(gdata + 1) + gedata_len;
sec_no++; sec_no++;
} }
} }
...@@ -396,6 +397,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus) ...@@ -396,6 +397,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
if (gedata_len > data_len - sizeof(*gdata)) if (gedata_len > data_len - sizeof(*gdata))
return -EINVAL; return -EINVAL;
data_len -= gedata_len + sizeof(*gdata); data_len -= gedata_len + sizeof(*gdata);
gdata = (void *)(gdata + 1) + gedata_len;
} }
if (data_len) if (data_len)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment