From: Lennart Poettering Date: Tue, 7 Apr 2026 20:25:24 +0000 (+0200) Subject: boot: minor clean-ups in initrd_unregister() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9879a192224fea214b77a37a98a049b45851cb42;p=thirdparty%2Fsystemd.git boot: minor clean-ups in initrd_unregister() --- diff --git a/src/boot/initrd.c b/src/boot/initrd.c index 569b757be7a..4babe1671d5 100644 --- a/src/boot/initrd.c +++ b/src/boot/initrd.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include "efi-log.h" -#include "efi.h" #include "initrd.h" #include "iovec-util-fundamental.h" #include "proto/device-path.h" @@ -112,16 +111,16 @@ EFI_STATUS initrd_register( } EFI_STATUS initrd_unregister(EFI_HANDLE initrd_handle) { - EFI_STATUS err; struct initrd_loader *loader; + EFI_STATUS err; if (!initrd_handle) return EFI_SUCCESS; - /* get the LoadFile2 protocol that we allocated earlier */ + /* Get the LoadFile2 protocol that we allocated earlier */ err = BS->HandleProtocol(initrd_handle, MAKE_GUID_PTR(EFI_LOAD_FILE2_PROTOCOL), (void **) &loader); if (err != EFI_SUCCESS) - return err; + return log_debug_status(err, "Failed to acquire LoadFile2 protocol on our own initrd handle: %m"); /* uninstall all protocols thus destroying the handle */ err = BS->UninstallMultipleProtocolInterfaces( @@ -130,9 +129,8 @@ EFI_STATUS initrd_unregister(EFI_HANDLE initrd_handle) { loader, NULL); if (err != EFI_SUCCESS) - return err; + return log_debug_status(err, "Failed to uninstall LoadFile2 protocol from our own initrd handle: %m"); - initrd_handle = NULL; free(loader); return EFI_SUCCESS; }