Skip to contentSkip to conversation

efi_net: add missing EFI_CALL in efi_net

PATCH In review Vincent Stehlé 2 participants 2 messages Feb 5 – Feb 6

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_net: add missing EFI_CALL in efi_net

The efi_reinstall_protocol_interface() function is a UEFI function; make sure to call it from within U-Boot using the EFI_CALL() macro.

This fixes the following assertion:

lib/efi_loader/efi_boottime.c:3752: efi_reinstall_protocol_interface: Assertion `__efi_entry_check()' failed.

To reproduce the issue, define LOG_DEBUG in lib/efi_loader/efi_boottime.c and build u-boot for your platform. Then, boot the U-Boot helloworld.efi application over the network. Example commands (adjust the URL and boot entry number):

=> efidebug boot add -u 0 net http://10.0.2.2:8000/helloworld.efi
=> efidebug boot order 0
=> bootefi bootmgr

Fixes dd5d82a59995 ("efi_loader: efi_net: Add device path cache")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
Cc Adriano Cordova <[email protected]>
---
 lib/efi_loader/efi_net.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
lib/efi_loader/efi_net.c +4 -2
index 0f8a851e3f2..c2b85dac236 100644
@@ -1024,8 +1024,10 @@ efi_status_t efi_netobj_set_dp(struct efi_net_obj *netobj, struct efi_device_pat
 		goto add;
 
 	// If it is already installed, try to update it
-	ret = efi_reinstall_protocol_interface(&netobj->header, &efi_guid_device_path,
-					       phandler->protocol_interface, new_net_dp);
+	ret = EFI_CALL(efi_reinstall_protocol_interface(&netobj->header,
+							&efi_guid_device_path,
+							phandler->protocol_interface,
+							new_net_dp));
 	if (ret != EFI_SUCCESS)
 		return ret;
 
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Vincent Stehlé

The efi_reinstall_protocol_interface() function is a UEFI function; make sure to call it from within U-Boot using the EFI_CALL() macro.

This fixes the following assertion:

lib/efi_loader/efi_boottime.c:3752: efi_reinstall_protocol_interface: Assertion `__efi_entry_check()' failed.

To reproduce the issue, define LOG_DEBUG in lib/efi_loader/efi_boottime.c and build u-boot for your platform. Then, boot the U-Boot helloworld.efi application over the network. Example commands (adjust the URL and boot entry number):

=> efidebug boot add -u 0 net http://10.0.2.2:8000/helloworld.efi
=> efidebug boot order 0
=> bootefi bootmgr

Quoted 6 lines
Fixes dd5d82a59995 ("efi_loader: efi_net: Add device path cache")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
Cc Adriano Cordova <[email protected]>

Thank you for fixing this.

Quoted 21 lines
---
  lib/efi_loader/efi_net.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
lib/efi_loader/efi_net.c +4 -2
index 0f8a851e3f2..c2b85dac236 100644
@@ -1024,8 +1024,10 @@ efi_status_t efi_netobj_set_dp(struct efi_net_obj *netobj, struct efi_device_pat
  		goto add;
 
  	// If it is already installed, try to update it
-	ret = efi_reinstall_protocol_interface(&netobj->header, &efi_guid_device_path,
-					       phandler->protocol_interface, new_net_dp);
+	ret = EFI_CALL(efi_reinstall_protocol_interface(&netobj->header,
+							&efi_guid_device_path,
+							phandler->protocol_interface,
+							new_net_dp));
  	if (ret != EFI_SUCCESS)
  		return ret;