aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Gong <gong.chen@linux.intel.com>2013-03-19 02:48:07 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-26 19:05:46 -0400
commitaaf9d93be71c68558c25b4052ac979ee6b7eb809 (patch)
treef11f4d597e1fb352cc67f6f9428951d44ecc4300
parent469dd1c4ac0869cf7d1f87eac9b5a93865c10b76 (diff)
ACPI / APEI: fix error status check condition for CPER
In Table 18-289, ACPI5.0 SPEC, the error data length in CPER Generic Error Data Entry can be 0, which means this generic error data entry can have only one header. So fix the check conditon for it. Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Reviewed-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/apei/cper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c
index 1e5d8a40101e..fefc2ca7cc3e 100644
--- a/drivers/acpi/apei/cper.c
+++ b/drivers/acpi/apei/cper.c
@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
405 return rc; 405 return rc;
406 data_len = estatus->data_length; 406 data_len = estatus->data_length;
407 gdata = (struct acpi_hest_generic_data *)(estatus + 1); 407 gdata = (struct acpi_hest_generic_data *)(estatus + 1);
408 while (data_len > sizeof(*gdata)) { 408 while (data_len >= sizeof(*gdata)) {
409 gedata_len = gdata->error_data_length; 409 gedata_len = gdata->error_data_length;
410 if (gedata_len > data_len - sizeof(*gdata)) 410 if (gedata_len > data_len - sizeof(*gdata))
411 return -EINVAL; 411 return -EINVAL;