aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/efivars.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-03-17 10:57:00 +0000
committerMatt Fleming <matt.fleming@intel.com>2014-04-17 13:53:43 +0100
commita5d92ad32dad94fd8f3f61778561d532bb3a2f77 (patch)
tree16c7c63f80dedd7996d0efb341aa34ba8b295993 /drivers/firmware/efi/efivars.c
parente003bbee2a6a19a4c733335989284caf1b179e0d (diff)
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>
Diffstat (limited to 'drivers/firmware/efi/efivars.c')
-rw-r--r--drivers/firmware/efi/efivars.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 2c21cccc257..5ee2cfb9669 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
@@ -231,7 +231,7 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)
}
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 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj,
{
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 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj,
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;
}