]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: avoid using HandleProtocol in initrddump.efi
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 4 Apr 2023 05:23:53 +0000 (07:23 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 8 Apr 2023 05:45:34 +0000 (07:45 +0200)
HandleProtocol() is deprecated and leaves an OpenedProtocolInformation
behind. Use OpenProtocol(GET_PROTOCOL) instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/initrddump.c

index 971a3b6236c96698a903843fbe014afb2a0106b9..5b470f481946eaa0d6a3775b5bf7df17bb5f950a 100644 (file)
@@ -291,8 +291,9 @@ static efi_status_t get_initrd(void **initrd, efi_uintn_t *initrd_size)
                error(u"Load File2 protocol not found\r\n");
                return ret;
        }
-       ret = bs->handle_protocol(handle, &load_file2_guid,
-                                (void **)&load_file2_prot);
+       ret = bs->open_protocol(handle, &load_file2_guid,
+                               (void **)&load_file2_prot, NULL, NULL,
+                               EFI_OPEN_PROTOCOL_GET_PROTOCOL);
        ret = load_file2_prot->load_file(load_file2_prot, dp, false,
                                         initrd_size, NULL);
        if (ret != EFI_BUFFER_TOO_SMALL) {