diff options
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/efivars.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index bf7a6f994a3c..6e51c1e81f14 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -773,6 +773,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
773 | { | 773 | { |
774 | char name[DUMP_NAME_LEN]; | 774 | char name[DUMP_NAME_LEN]; |
775 | efi_char16_t efi_name[DUMP_NAME_LEN]; | 775 | efi_char16_t efi_name[DUMP_NAME_LEN]; |
776 | char name_old[DUMP_NAME_LEN]; | ||
777 | efi_char16_t efi_name_old[DUMP_NAME_LEN]; | ||
776 | efi_guid_t vendor = LINUX_EFI_CRASH_GUID; | 778 | efi_guid_t vendor = LINUX_EFI_CRASH_GUID; |
777 | struct efivars *efivars = psi->data; | 779 | struct efivars *efivars = psi->data; |
778 | struct efivar_entry *entry, *found = NULL; | 780 | struct efivar_entry *entry, *found = NULL; |
@@ -796,8 +798,22 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
796 | if (efi_guidcmp(entry->var.VendorGuid, vendor)) | 798 | if (efi_guidcmp(entry->var.VendorGuid, vendor)) |
797 | continue; | 799 | continue; |
798 | if (utf16_strncmp(entry->var.VariableName, efi_name, | 800 | if (utf16_strncmp(entry->var.VariableName, efi_name, |
799 | utf16_strlen(efi_name))) | 801 | utf16_strlen(efi_name))) { |
800 | continue; | 802 | /* |
803 | * Check if an old format, | ||
804 | * which doesn't support holding | ||
805 | * multiple logs, remains. | ||
806 | */ | ||
807 | sprintf(name_old, "dump-type%u-%u-%lu", type, | ||
808 | (unsigned int)id, time.tv_sec); | ||
809 | |||
810 | for (i = 0; i < DUMP_NAME_LEN; i++) | ||
811 | efi_name_old[i] = name_old[i]; | ||
812 | |||
813 | if (utf16_strncmp(entry->var.VariableName, efi_name_old, | ||
814 | utf16_strlen(efi_name_old))) | ||
815 | continue; | ||
816 | } | ||
801 | 817 | ||
802 | /* found */ | 818 | /* found */ |
803 | found = entry; | 819 | found = entry; |