]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: fix efi_initrd_deregister()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 29 Sep 2022 23:55:02 +0000 (01:55 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 30 Sep 2022 00:03:23 +0000 (02:03 +0200)
Don't try to delete a non-existent handle.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_load_initrd.c

index c5e6652e664bd7ac2052e1b9b76651f5fea60ac5..3d6044f76047cb2c6b7c0a83e4bb9be03447da0a 100644 (file)
@@ -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;
 }