From bac318743905e55ce424104cafbc8418e0672a80 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 23 Mar 2025 19:11:13 +0000 Subject: [efi] Use efi_open() for all ephemeral protocol opens Signed-off-by: Michael Brown --- src/interface/efi/efi_init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/interface/efi/efi_init.c') diff --git a/src/interface/efi/efi_init.c b/src/interface/efi/efi_init.c index a45ee66a4..03506ec5c 100644 --- a/src/interface/efi/efi_init.c +++ b/src/interface/efi/efi_init.c @@ -263,13 +263,12 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, efi_cmdline_len = efi_loaded_image->LoadOptionsSize; /* Get loaded image's device handle's device path */ - if ( ( efirc = bs->OpenProtocol ( efi_loaded_image->DeviceHandle, - &efi_device_path_protocol_guid, - &device_path, image_handle, NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) { - rc = -EEFI ( efirc ); + if ( ( rc = efi_open ( efi_loaded_image->DeviceHandle, + &efi_device_path_protocol_guid, + &device_path ) ) != 0 ) { DBGC ( systab, "EFI could not get loaded image's device path: " "%s", strerror ( rc ) ); + efirc = EFIRC ( rc ); goto err_no_device_path; } -- cgit v1.2.3-55-g7522