4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpen...@oracle.com>

commit a75dcb5848359f488c32c0aef8711d9bd37a77b8 upstream.

We should return -ENOMEM here, instead of success.

Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>
Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: linux-...@vger.kernel.org
Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables")
Link: http://lkml.kernel.org/r/20161018143318.15673-9-m...@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mi...@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/firmware/efi/efi.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -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) {


Reply via email to