From patchwork Mon Dec 4 17:03:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 844328 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yrB742xyRz9t3x for ; Tue, 5 Dec 2017 04:04:16 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B017DC21EB4; Mon, 4 Dec 2017 17:04:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 99C65C21DA6; Mon, 4 Dec 2017 17:04:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 145A5C21E31; Mon, 4 Dec 2017 17:04:08 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lists.denx.de (Postfix) with ESMTPS id A8637C21DA6 for ; Mon, 4 Dec 2017 17:04:07 +0000 (UTC) Received: from workstation4.fritz.box ([94.114.42.150]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0LZmd6-1enJV33S1M-00lYIX; Mon, 04 Dec 2017 18:04:05 +0100 From: Heinrich Schuchardt To: Alexander Graf Date: Mon, 4 Dec 2017 18:03:01 +0100 Message-Id: <20171204170303.24758-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204170303.24758-1-xypron.glpk@gmx.de> References: <20171204170303.24758-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:8C+ybo5EY+PsgFeU8lEEPm4xHK3N/IRVmskwx0M2oUlyz/Y8znG 2z0yhn8RXindcEJiRVllhN7JuSAHUur5lozUzVz2kP9qBE/UIklzA2qw4KUDeNikJz9Olmn Hx3M0cFd0mdxw5uisIZDZtrQAvBBJb4zPEsJRvgbbNhw9NrvB7L1yT1LkmHqg+xEYZG/IG4 5Vs0nFbl0qVf2EU4cYTqA== X-UI-Out-Filterresults: notjunk:1; V01:K0:fnj3b/TPwf4=:TeV1tVe1rGPvQeyklxAEmR +Oue34CTKCkG6CZcxQceKOtTDL1GWaQPnHhn968naJou/sEw+sPo4M7sgj6MD1aCpVUMh2lgw 9Sm3xLqDObOqA0wrhipxxqBglmC9wjh5U7cu63vZIROvY1TatCrRGiQMC7E/wbkdE9uWjD2Hk fHDKrZCOFDRRNBfE4X4XTb5wccLGMdxaZrHjedB1ck1ZuTk89W4lBEfeUD2tzNV7fGDSCVWM1 Ex8BlVzclkmoL25XRpo9avfoNDH19gmxBa0jxUAOdGxt6gLyqIWZcvUlfIzXMakyv3ADCZXqg GA8jZ27ykSpvT3wS00CMmO2O1JjyONQCChekNSqDpal5IJZ/xChcYwMc3+nF7J9dMPmobur+D twCd6aZhu9TVp5RGvMpnBC7G4gHf5pS3MG9CzwTn1DblPfS+3LWScZwofs0Rh+4b3F5RpAZl3 87aLjTFxYqBkK2P+dpnMm9Bc928svKLnJUISMVXxjhMKpdYZxueSJPi5JdZPmalm8i5bE6vAQ wle5LE1/RiAFTAE2LxSkFQ6WK7s/P/4Zz0bHs137651L8ilw5EJj9Ar+zYaVBQxirlNy3yDFr 2MnQsJExNdaXjqE/BWOKr3phjQRNLv7kbsIUnjhatYQ55SxWUqchctTpbP8qOMttFVpHmG3Ma 8T+YTCibjEfkGyrJlW/3hiTPYj03N+/oqKS4ogZQbnTVaiVxm9ld14OTAVxWi8cY0VdQdjeIS y9Et+q0WEavmOystVEXJCHFgY/TmHM6ZNqkDEgAYmuLD3sOWWaYh57SrUK8t0zWDYadExmAHO V3gn/o0jXUjdjbw1AE/xA+8TEyVyQ== Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH 1/3] efi_loader: return status from efi_setup_loaded_image() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" efi_setup_loaded_image() should return an error code indicating if an error has occurred. An error occurs if a protocol cannot be installed. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 8 +++++--- lib/efi_loader/efi_boottime.c | 11 +++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index c0caabddb1..78237f14ae 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -249,9 +249,11 @@ uint64_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type, int efi_memory_init(void); /* Adds new or overrides configuration table entry to the system table */ efi_status_t efi_install_configuration_table(const efi_guid_t *guid, void *table); -void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *obj, - struct efi_device_path *device_path, - struct efi_device_path *file_path); +/* Sets up a loaded image */ +efi_status_t efi_setup_loaded_image( + struct efi_loaded_image *info, struct efi_object *obj, + struct efi_device_path *device_path, + struct efi_device_path *file_path); efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, void **buffer); diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index a37fb25638..a9ba1ac394 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1170,10 +1170,12 @@ static efi_status_t EFIAPI efi_install_configuration_table_ext(efi_guid_t *guid, * @obj internal object associated with the loaded image * @device_path device path of the loaded image * @file_path file path of the loaded image + * @return status code */ -void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *obj, - struct efi_device_path *device_path, - struct efi_device_path *file_path) +efi_status_t efi_setup_loaded_image( + struct efi_loaded_image *info, struct efi_object *obj, + struct efi_device_path *device_path, + struct efi_device_path *file_path) { efi_status_t ret; @@ -1213,9 +1215,10 @@ void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *ob if (ret != EFI_SUCCESS) goto failure; - return; + return ret; failure: printf("ERROR: Failure to install protocols for loaded image\n"); + return ret; } /*