mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 08:31:55 +00:00
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>
This commit is contained in:
parent
469dd1c4ac
commit
aaf9d93be7
@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)
|
|||||||
return rc;
|
return rc;
|
||||||
data_len = estatus->data_length;
|
data_len = estatus->data_length;
|
||||||
gdata = (struct acpi_hest_generic_data *)(estatus + 1);
|
gdata = (struct acpi_hest_generic_data *)(estatus + 1);
|
||||||
while (data_len > sizeof(*gdata)) {
|
while (data_len >= sizeof(*gdata)) {
|
||||||
gedata_len = gdata->error_data_length;
|
gedata_len = gdata->error_data_length;
|
||||||
if (gedata_len > data_len - sizeof(*gdata))
|
if (gedata_len > data_len - sizeof(*gdata))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user