mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
efibc: Report more information in the error messages
Report the name of the EFI variable if the value size is too large, or if efibc_set_variable() fails to allocate the 'struct efivar_entry' object. If efibc_set_variable() fails because the 'size' value is too large, it also reports this value in the error message. Reported-by: Robert Elliott <[email protected]> Signed-off-by: Jeremy Compostella <[email protected]> Signed-off-by: Matt Fleming <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Minor readability edits. ] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
4c2e07c6a2
commit
5356c32742
1 changed files with 2 additions and 2 deletions
|
|
@ -37,13 +37,13 @@ static int efibc_set_variable(const char *name, const char *value)
|
|||
size_t size = (strlen(value) + 1) * sizeof(efi_char16_t);
|
||||
|
||||
if (size > sizeof(entry->var.Data)) {
|
||||
pr_err("value is too large");
|
||||
pr_err("value is too large (%zu bytes) for '%s' EFI variable\n", size, name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
|
||||
if (!entry) {
|
||||
pr_err("failed to allocate efivar entry");
|
||||
pr_err("failed to allocate efivar entry for '%s' EFI variable\n", name);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue