summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-05-20 21:27:29 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-05-21 10:00:17 +0200
commitc067cef695d8909f2c453eb9fedb718206d906a4 (patch)
tree4347226bc92f5f8de7c8cb9964e7eb238984eb2c /lib
parent255a47333cc3e430d544fadf419b290213c5b11b (diff)
efi_loader: initialize root node first
With commit 16ad946f41d3 ("efi_loader: change setup sequence") the detection of block device was moved to the start of the initialization sequence. In the case of virtio devices two handles with the same device path being created. The root node handle should be created before anything else. Reported-by: Ard Biesheuvel <ardb@kernel.org> Fixes: 16ad946f41d3 ("efi_loader: change setup sequence") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_setup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 26a7423203..dd0c53fc23 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -135,6 +135,11 @@ efi_status_t efi_init_obj_list(void)
/* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */
switch_to_non_secure_mode();
+ /* Initialize root node */
+ ret = efi_root_node_register();
+ if (ret != EFI_SUCCESS)
+ goto out;
+
#ifdef CONFIG_PARTITIONS
ret = efi_disk_register();
if (ret != EFI_SUCCESS)
@@ -175,11 +180,6 @@ efi_status_t efi_init_obj_list(void)
if (ret != EFI_SUCCESS)
goto out;
- /* Initialize root node */
- ret = efi_root_node_register();
- if (ret != EFI_SUCCESS)
- goto out;
-
/* Initialize EFI driver uclass */
ret = efi_driver_init();
if (ret != EFI_SUCCESS)