Skip to content

Commit

Permalink
efivars: Call guid_parse() against guid_t type of variable
Browse files Browse the repository at this point in the history
uuid_le_to_bin() is deprecated API and take into consideration that variable,
to where we store parsed data, is type of guid_t we switch to guid_parse()
for sake of consistency.

While here, add error checking to it.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Lukas Wunner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
andy-shev authored and Ingo Molnar committed Jul 22, 2018
1 parent e8f4194 commit c432656
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/efivarfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry,
/* length of the variable name itself: remove GUID and separator */
namelen = dentry->d_name.len - EFI_VARIABLE_GUID_LEN - 1;

uuid_le_to_bin(dentry->d_name.name + namelen + 1, &var->var.VendorGuid);
err = guid_parse(dentry->d_name.name + namelen + 1, &var->var.VendorGuid);
if (err)
goto out;

if (efivar_variable_is_removable(var->var.VendorGuid,
dentry->d_name.name, namelen))
Expand Down

0 comments on commit c432656

Please sign in to comment.