[PATCH 1/1] efi_loader: fix efi_initrd_deregister()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Fri Sep 30 01:57:48 CEST 2022


Don't try to delete a non-existent handle.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/efi_loader/efi_load_initrd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c
index c5e6652e66..3d6044f760 100644
--- a/lib/efi_loader/efi_load_initrd.c
+++ b/lib/efi_loader/efi_load_initrd.c
@@ -230,6 +230,9 @@ efi_status_t efi_initrd_register(void)
  */
 void efi_initrd_deregister(void)
 {
+	if (!efi_initrd_handle)
+		return;
+
 	efi_delete_handle(efi_initrd_handle);
 	efi_initrd_handle = NULL;
 }
-- 
2.37.2



More information about the U-Boot mailing list