diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-07-19 21:47:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-07-22 08:13:44 -0400 |
commit | c4326563d9abe86ad54474f9e9142bd2663eede5 (patch) | |
tree | 82733867ac768603e8b383d1fc39d6c115222f5d | |
parent | e8f4194d9b98aa13f9f567a0056bbf683d2b1ab8 (diff) |
efivars: Call guid_parse() against guid_t type of variable
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 <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180720014726.24031-10-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | fs/efivarfs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index 71fccccf317e..8c6ab6c95727 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c | |||
@@ -86,7 +86,9 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry, | |||
86 | /* length of the variable name itself: remove GUID and separator */ | 86 | /* length of the variable name itself: remove GUID and separator */ |
87 | namelen = dentry->d_name.len - EFI_VARIABLE_GUID_LEN - 1; | 87 | namelen = dentry->d_name.len - EFI_VARIABLE_GUID_LEN - 1; |
88 | 88 | ||
89 | uuid_le_to_bin(dentry->d_name.name + namelen + 1, &var->var.VendorGuid); | 89 | err = guid_parse(dentry->d_name.name + namelen + 1, &var->var.VendorGuid); |
90 | if (err) | ||
91 | goto out; | ||
90 | 92 | ||
91 | if (efivar_variable_is_removable(var->var.VendorGuid, | 93 | if (efivar_variable_is_removable(var->var.VendorGuid, |
92 | dentry->d_name.name, namelen)) | 94 | dentry->d_name.name, namelen)) |