[Concept,01/18] efi: Correct calculate_paths() when an image is used

Message ID 20250902152158.2285264-2-sjg@u-boot.org
State New
Headers
Series efi: Improve integration of the app with a Shim environment |

Commit Message

Simon Glass Sept. 2, 2025, 3:21 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

The device path is updated if an image is used, so move the setting of
*device_pathp lower, to take account of this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 73ad2d99093 ("efi: Move efi_bootflow_run() to a common file")
---

 lib/efi/run.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/efi/run.c b/lib/efi/run.c
index 4f47743476d..1903d6f0b9a 100644
--- a/lib/efi/run.c
+++ b/lib/efi/run.c
@@ -46,7 +46,6 @@  efi_status_t calculate_paths(const char *dev, const char *devnr,
 	if (ret != EFI_SUCCESS)
 		return ret;
 
-	*device_pathp = device;
 	if (image) {
 		/* FIXME: image should not contain device */
 		struct efi_device_path *image_tmp = image;
@@ -54,6 +53,7 @@  efi_status_t calculate_paths(const char *dev, const char *devnr,
 		efi_dp_split_file_path(image, &device, &image);
 		efi_free_pool(image_tmp);
 	}
+	*device_pathp = device;
 	*image_pathp = image;
 	log_debug("- boot device %pD\n", device);
 	if (image)