efivars: Stop passing a struct argument to efivar_validate()
In preparation for compat support, we can't assume that user variable
object is represented by a 'struct efi_variable'. Convert the validation
functions to take the variable name as an argument, which is the only
piece of the struct that was ever used anyway.
Cc: Mike Waychison <mikew@google.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 2c21ccc..5ee2cfb 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
@@ -231,7 +231,7 @@
}
if ((attributes & ~EFI_VARIABLE_MASK) != 0 ||
- efivar_validate(new_var, data, size) == false) {
+ efivar_validate(name, data, size) == false) {
printk(KERN_ERR "efivars: Malformed variable content\n");
return -EINVAL;
}
@@ -339,6 +339,7 @@
{
struct efi_variable *new_var = (struct efi_variable *)buf;
struct efivar_entry *new_entry;
+ efi_char16_t *name;
unsigned long size;
u32 attributes;
u8 *data;
@@ -351,11 +352,12 @@
return -EINVAL;
attributes = new_var->Attributes;
+ name = new_var->VariableName;
size = new_var->DataSize;
data = new_var->Data;
if ((attributes & ~EFI_VARIABLE_MASK) != 0 ||
- efivar_validate(new_var, data, size) == false) {
+ efivar_validate(name, data, size) == false) {
printk(KERN_ERR "efivars: Malformed variable content\n");
return -EINVAL;
}