CPER failed to handle generic error records with multiple sections
authorJiang Liu <liuj97@gmail.com>
Tue, 14 Feb 2012 16:01:44 +0000 (00:01 +0800)
committerLen Brown <len.brown@intel.com>
Fri, 30 Mar 2012 08:01:26 +0000 (04:01 -0400)
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>
drivers/acpi/apei/cper.c

index 5d41894..e6defd8 100644 (file)
@@ -362,6 +362,7 @@ void apei_estatus_print(const char *pfx,
                gedata_len = gdata->error_data_length;
                apei_estatus_print_section(pfx, gdata, sec_no);
                data_len -= gedata_len + sizeof(*gdata);
+               gdata = (void *)(gdata + 1) + gedata_len;
                sec_no++;
        }
 }
@@ -396,6 +397,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
                if (gedata_len > data_len - sizeof(*gdata))
                        return -EINVAL;
                data_len -= gedata_len + sizeof(*gdata);
+               gdata = (void *)(gdata + 1) + gedata_len;
        }
        if (data_len)
                return -EINVAL;