#include <linux/efi.h>
#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/ucs2_string.h>
#define EFIVARS_VERSION "0.08"
#define EFIVARS_DATE "2004-May-17"
efi_char16_t *variable_name;
variable_name = new_var->var.VariableName;
- variable_name_size = utf16_strlen(variable_name) * sizeof(efi_char16_t);
+ variable_name_size = ucs2_strlen(variable_name) * sizeof(efi_char16_t);
/*
* Length of the variable bytes in ASCII, plus the '-' separator,
short_name = kzalloc(short_name_size, GFP_KERNEL);
- if (!short_name) {
- kfree(short_name);
+ if (!short_name)
return 1;
- }
/* Convert Unicode to normal chars (assume top bits are 0),
ala UTF-8 */
struct efivar_entry *entry;
int err;
- entry = kzalloc(sizeof(*entry), GFP_KERNEL);
- if (!entry)
- return;
-
/* Add new sysfs entries */
while (1) {
- memset(entry, 0, sizeof(*entry));
+ entry = kzalloc(sizeof(*entry), GFP_KERNEL);
+ if (!entry)
+ return;
err = efivar_init(efivar_update_sysfs_entry, entry,
true, false, &efivar_sysfs_list);