[PATCH] efi: fix GetNextDevicePathInstance trace argument

Ahmad Fatoum a.fatoum at barebox.org
Thu Jul 9 00:44:28 PDT 2026


Verbose EFI tracing formats device paths with %pD. The
GetNextDevicePathInstance wrapper receives an EFI_DEVICE_PATH **, but passed
that pointer slot directly to %pD. When the SCT called the service, the trace
formatter interpreted stack bytes as a device path and could loop before the
service body was reached.

Log the pointed-to device path when the argument itself is present. This keeps
the trace useful while avoiding a tracing-induced hang during the Device Path
Utilities ACS coverage.

Assisted-by: Codex:gpt-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 efi/loader/protocols/device_path_utilities.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/efi/loader/protocols/device_path_utilities.c b/efi/loader/protocols/device_path_utilities.c
index ef88e2d647fb..8788149f6de4 100644
--- a/efi/loader/protocols/device_path_utilities.c
+++ b/efi/loader/protocols/device_path_utilities.c
@@ -143,7 +143,8 @@ static struct efi_device_path * EFIAPI get_next_device_path_instance(
 	struct efi_device_path **device_path_instance,
 	efi_uintn_t *device_path_instance_size)
 {
-	EFI_ENTRY("%pD, %p", device_path_instance, device_path_instance_size);
+	EFI_ENTRY("%pD, %p", device_path_instance ? *device_path_instance : NULL,
+		  device_path_instance_size);
 	return EFI_EXIT(efi_dp_get_next_instance(device_path_instance,
 						 device_path_instance_size));
 }
-- 
2.47.3




More information about the barebox mailing list