efi_loader: avoid using HandleProtocol in initrddump.efi

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>
This commit is contained in:
Heinrich Schuchardt 2023-04-04 07:23:53 +02:00
parent ff6ce8da97
commit 199675b9d5

View 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"); error(u"Load File2 protocol not found\r\n");
return ret; return ret;
} }
ret = bs->handle_protocol(handle, &load_file2_guid, ret = bs->open_protocol(handle, &load_file2_guid,
(void **)&load_file2_prot); (void **)&load_file2_prot, NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
ret = load_file2_prot->load_file(load_file2_prot, dp, false, ret = load_file2_prot->load_file(load_file2_prot, dp, false,
initrd_size, NULL); initrd_size, NULL);
if (ret != EFI_BUFFER_TOO_SMALL) { if (ret != EFI_BUFFER_TOO_SMALL) {