aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/apei/einj.c4
-rw-r--r--drivers/acpi/apei/erst.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 465c885938e..cf29df69380 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -426,7 +426,9 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL,
426 426
427static int einj_check_table(struct acpi_table_einj *einj_tab) 427static int einj_check_table(struct acpi_table_einj *einj_tab)
428{ 428{
429 if (einj_tab->header_length != sizeof(struct acpi_table_einj)) 429 if ((einj_tab->header_length !=
430 (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))
431 && (einj_tab->header_length != sizeof(struct acpi_table_einj)))
430 return -EINVAL; 432 return -EINVAL;
431 if (einj_tab->header.length < sizeof(struct acpi_table_einj)) 433 if (einj_tab->header.length < sizeof(struct acpi_table_einj))
432 return -EINVAL; 434 return -EINVAL;
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 18645f4e83c..10cc1928ec2 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -750,7 +750,9 @@ __setup("erst_disable", setup_erst_disable);
750 750
751static int erst_check_table(struct acpi_table_erst *erst_tab) 751static int erst_check_table(struct acpi_table_erst *erst_tab)
752{ 752{
753 if (erst_tab->header_length != sizeof(struct acpi_table_erst)) 753 if ((erst_tab->header_length !=
754 (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))
755 && (erst_tab->header_length != sizeof(struct acpi_table_einj)))
754 return -EINVAL; 756 return -EINVAL;
755 if (erst_tab->header.length < sizeof(struct acpi_table_erst)) 757 if (erst_tab->header.length < sizeof(struct acpi_table_erst))
756 return -EINVAL; 758 return -EINVAL;