summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_load_initrd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/efi_loader/efi_load_initrd.c')
-rw-r--r--lib/efi_loader/efi_load_initrd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c
index c5e6652e664..3d6044f7604 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;
}