diff options
Diffstat (limited to 'drivers/acpi/apei/einj.c')
| -rw-r--r-- | drivers/acpi/apei/einj.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 465c885938ee..cf29df69380b 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 | ||
| 427 | static int einj_check_table(struct acpi_table_einj *einj_tab) | 427 | static 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; |
