#include <linux/efi.h>
#include <linux/module.h>
#include <linux/pstore.h>
+#include <linux/slab.h>
+#include <linux/ucs2_string.h>
#define DUMP_NAME_LEN 52
} else
return 0;
- __efivar_entry_size(entry, &size);
+ entry->var.DataSize = 1024;
+ __efivar_entry_get(entry, &entry->var.Attributes,
+ &entry->var.DataSize, entry->var.Data);
+ size = entry->var.DataSize;
+
*cb_data->buf = kmalloc(size, GFP_KERNEL);
if (*cb_data->buf == NULL)
return -ENOMEM;
efi_guid_t vendor = LINUX_EFI_CRASH_GUID;
efi_char16_t efi_name_old[DUMP_NAME_LEN];
efi_char16_t *efi_name = ed->name;
- unsigned long utf16_len = utf16_strlen(ed->name);
+ unsigned long ucs2_len = ucs2_strlen(ed->name);
char name_old[DUMP_NAME_LEN];
int i;
if (efi_guidcmp(entry->var.VendorGuid, vendor))
return 0;
- if (utf16_strncmp(entry->var.VariableName,
- efi_name, (size_t)utf16_len)) {
+ if (ucs2_strncmp(entry->var.VariableName,
+ efi_name, (size_t)ucs2_len)) {
/*
* Check if an old format, which doesn't support
* holding multiple logs, remains.
for (i = 0; i < DUMP_NAME_LEN; i++)
efi_name_old[i] = name_old[i];
- if (utf16_strncmp(entry->var.VariableName, efi_name_old,
- utf16_strlen(efi_name_old)))
+ if (ucs2_strncmp(entry->var.VariableName, efi_name_old,
+ ucs2_strlen(efi_name_old)))
return 0;
}
/* found */
__efivar_entry_delete(entry);
+ list_del(&entry->list);
+
return 1;
}
struct timespec time, struct pstore_info *psi)
{
struct pstore_erase_data edata;
- struct efivar_entry *entry;
+ struct efivar_entry *entry = NULL;
char name[DUMP_NAME_LEN];
efi_char16_t efi_name[DUMP_NAME_LEN];
int found, i;