[PATCH 1/1] efi_loader: avoid using HandleProtocol in initrddump.efi

Ilias Apalodimas ilias.apalodimas at linaro.org
Tue Apr 4 09:35:41 CEST 2023


On Tue, Apr 04, 2023 at 07:23:53AM +0200, Heinrich Schuchardt wrote:
> HandleProtocol() is deprecated and leaves an OpenedProtocolInformation
> behind. Use OpenProtocol(GET_PROTOCOL) instead.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  lib/efi_loader/initrddump.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/initrddump.c b/lib/efi_loader/initrddump.c
> index 971a3b6236..5b470f4819 100644
> --- a/lib/efi_loader/initrddump.c
> +++ b/lib/efi_loader/initrddump.c
> @@ -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) {
> --
> 2.39.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>



More information about the U-Boot mailing list