diff options
Diffstat (limited to 'drivers/firmware/efi/cper.c')
-rw-r--r-- | drivers/firmware/efi/cper.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index 48a8f69da42a..bf3672a81e49 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c | |||
@@ -606,7 +606,6 @@ void cper_estatus_print(const char *pfx, | |||
606 | const struct acpi_hest_generic_status *estatus) | 606 | const struct acpi_hest_generic_status *estatus) |
607 | { | 607 | { |
608 | struct acpi_hest_generic_data *gdata; | 608 | struct acpi_hest_generic_data *gdata; |
609 | unsigned int data_len; | ||
610 | int sec_no = 0; | 609 | int sec_no = 0; |
611 | char newpfx[64]; | 610 | char newpfx[64]; |
612 | __u16 severity; | 611 | __u16 severity; |
@@ -617,14 +616,10 @@ void cper_estatus_print(const char *pfx, | |||
617 | "It has been corrected by h/w " | 616 | "It has been corrected by h/w " |
618 | "and requires no further action"); | 617 | "and requires no further action"); |
619 | printk("%s""event severity: %s\n", pfx, cper_severity_str(severity)); | 618 | printk("%s""event severity: %s\n", pfx, cper_severity_str(severity)); |
620 | data_len = estatus->data_length; | ||
621 | gdata = (struct acpi_hest_generic_data *)(estatus + 1); | ||
622 | snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP); | 619 | snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP); |
623 | 620 | ||
624 | while (data_len >= acpi_hest_get_size(gdata)) { | 621 | apei_estatus_for_each_section(estatus, gdata) { |
625 | cper_estatus_print_section(newpfx, gdata, sec_no); | 622 | cper_estatus_print_section(newpfx, gdata, sec_no); |
626 | data_len -= acpi_hest_get_record_size(gdata); | ||
627 | gdata = acpi_hest_get_next(gdata); | ||
628 | sec_no++; | 623 | sec_no++; |
629 | } | 624 | } |
630 | } | 625 | } |
@@ -653,15 +648,12 @@ int cper_estatus_check(const struct acpi_hest_generic_status *estatus) | |||
653 | if (rc) | 648 | if (rc) |
654 | return rc; | 649 | return rc; |
655 | data_len = estatus->data_length; | 650 | data_len = estatus->data_length; |
656 | gdata = (struct acpi_hest_generic_data *)(estatus + 1); | ||
657 | 651 | ||
658 | while (data_len >= acpi_hest_get_size(gdata)) { | 652 | apei_estatus_for_each_section(estatus, gdata) { |
659 | gedata_len = acpi_hest_get_error_length(gdata); | 653 | gedata_len = acpi_hest_get_error_length(gdata); |
660 | if (gedata_len > data_len - acpi_hest_get_size(gdata)) | 654 | if (gedata_len > data_len - acpi_hest_get_size(gdata)) |
661 | return -EINVAL; | 655 | return -EINVAL; |
662 | |||
663 | data_len -= acpi_hest_get_record_size(gdata); | 656 | data_len -= acpi_hest_get_record_size(gdata); |
664 | gdata = acpi_hest_get_next(gdata); | ||
665 | } | 657 | } |
666 | if (data_len) | 658 | if (data_len) |
667 | return -EINVAL; | 659 | return -EINVAL; |