diff options
author | Jiang Liu <liuj97@gmail.com> | 2012-02-14 11:01:44 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-03-30 04:01:26 -0400 |
commit | 37d2a3622d249d83413c92a1cd9e94b5237d0fcc (patch) | |
tree | 81456457d095b0615dd1664b12c880fe8859e449 /drivers/acpi/apei | |
parent | 15afae604651d4e17652d2ffb56f5e36f991cfef (diff) |
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: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/apei')
-rw-r--r-- | drivers/acpi/apei/cper.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c index 5d4189464d63..e6defd86b424 100644 --- a/drivers/acpi/apei/cper.c +++ b/drivers/acpi/apei/cper.c | |||
@@ -362,6 +362,7 @@ void apei_estatus_print(const char *pfx, | |||
362 | gedata_len = gdata->error_data_length; | 362 | gedata_len = gdata->error_data_length; |
363 | apei_estatus_print_section(pfx, gdata, sec_no); | 363 | apei_estatus_print_section(pfx, gdata, sec_no); |
364 | data_len -= gedata_len + sizeof(*gdata); | 364 | data_len -= gedata_len + sizeof(*gdata); |
365 | gdata = (void *)(gdata + 1) + gedata_len; | ||
365 | sec_no++; | 366 | sec_no++; |
366 | } | 367 | } |
367 | } | 368 | } |
@@ -396,6 +397,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus) | |||
396 | if (gedata_len > data_len - sizeof(*gdata)) | 397 | if (gedata_len > data_len - sizeof(*gdata)) |
397 | return -EINVAL; | 398 | return -EINVAL; |
398 | data_len -= gedata_len + sizeof(*gdata); | 399 | data_len -= gedata_len + sizeof(*gdata); |
400 | gdata = (void *)(gdata + 1) + gedata_len; | ||
399 | } | 401 | } |
400 | if (data_len) | 402 | if (data_len) |
401 | return -EINVAL; | 403 | return -EINVAL; |