[PATCH 1/1] efi_loader: initialize variables in efi_dp_from_http()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Wed Apr 29 17:40:00 CEST 2026


When using lwIP, efi_dp_from_http() may fail to initialize ip or mask.
Initialize the variables before the call.

Addresses-Coverity-ID: 645840 - Uninitialized variables (UNINIT)
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/efi_loader/efi_device_path.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index b3fb20b2501..9efb158f5dd 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -955,8 +955,8 @@ struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev
 	efi_uintn_t uridp_len;
 	char *pos;
 	char tmp[128];
-	struct efi_ipv4_address ip;
-	struct efi_ipv4_address mask;
+	struct efi_ipv4_address ip = { .ip_addr = { 0, 0, 0, 0 } };
+	struct efi_ipv4_address mask = { .ip_addr = { 0, 0, 0, 0 } };
 
 	if ((server && strlen("http://") + strlen(server) + 1  > sizeof(tmp)) ||
 	    (!server && IS_ENABLED(CONFIG_NET_LWIP)))
-- 
2.53.0



More information about the U-Boot mailing list