Skip to content

Commit

Permalink
efi/efivar_ssdt_load: Don't return success on allocation failure
Browse files Browse the repository at this point in the history
We should return -ENOMEM here, instead of success.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Fixes: 475fb4e ("efi / ACPI: load SSTDs from EFI variables")
Link: http://lkml.kernel.org/r/20161018143318.15673-9-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Dan Carpenter authored and Ingo Molnar committed Oct 18, 2016
1 parent 753375a commit a75dcb5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/firmware/efi/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ static __init int efivar_ssdt_load(void)
}

data = kmalloc(size, GFP_KERNEL);
if (!data)
if (!data) {
ret = -ENOMEM;
goto free_entry;
}

ret = efivar_entry_get(entry, NULL, &size, data);
if (ret) {
Expand Down

0 comments on commit a75dcb5

Please sign in to comment.