From mboxrd@z Thu Jan 1 00:00:00 1970 From: AKASHI Takahiro Date: Tue, 16 Apr 2019 13:24:19 +0900 Subject: [U-Boot] [RFC v3 01/10] efi_loader: device_path: handle special case of loading In-Reply-To: <20190416042428.5007-1-takahiro.akashi@linaro.org> References: <20190416042428.5007-1-takahiro.akashi@linaro.org> Message-ID: <20190416042428.5007-2-takahiro.akashi@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This is a preparatory patch. efi_dp_split_file_path() is used to create device_path and file_path from file_path for efi_setup_loaded_image(). In a special case, however, of HARDWARE_DEVICE/MEMORY, it doesn't work expectedly since this path doesn't contain any FILE_PATH sub-type. This patch makes a workaround. Signed-off-by: AKASHI Takahiro --- lib/efi_loader/efi_device_path.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 53b40c8c3c2d..e283fad767ed 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -933,6 +933,14 @@ efi_status_t efi_dp_split_file_path(struct efi_device_path *full_path, dp = efi_dp_dup(full_path); if (!dp) return EFI_OUT_OF_RESOURCES; + + if (EFI_DP_TYPE(dp, HARDWARE_DEVICE, MEMORY)) { + /* no FILE_PATH */ + *device_path = dp; + + return EFI_SUCCESS; + } + p = dp; while (!EFI_DP_TYPE(p, MEDIA_DEVICE, FILE_PATH)) { p = efi_dp_next(p); -- 2.20.1