Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935027AbcJROfS (ORCPT ); Tue, 18 Oct 2016 10:35:18 -0400 Received: from mail-qt0-f171.google.com ([209.85.216.171]:34983 "EHLO mail-qt0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761619AbcJROdb (ORCPT ); Tue, 18 Oct 2016 10:33:31 -0400 From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Dan Carpenter , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH 8/8] efi: efivar_ssdt_load: Don't return success on allocation failure Date: Tue, 18 Oct 2016 15:33:18 +0100 Message-Id: <20161018143318.15673-9-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161018143318.15673-1-matt@codeblueprint.co.uk> References: <20161018143318.15673-1-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 806 Lines: 29 From: Dan Carpenter We should return -ENOMEM here, instead of success. Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables") Signed-off-by: Dan Carpenter Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 1ac199cd75e7..a4944e22f294 100644 --- 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) { -- 2.10.0