[PATCH 4/4] efi_loader: simplify efi_serialize_load_option()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Apr 2 11:47:01 CEST 2022


Use u16_strsize().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/efi_loader/efi_load_options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi_loader/efi_load_options.c
index 68cd85ba2e..71454f0fc6 100644
--- a/lib/efi_loader/efi_load_options.c
+++ b/lib/efi_loader/efi_load_options.c
@@ -113,7 +113,7 @@ unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data)
 	unsigned long size;
 	u8 *p;
 
-	label_len = (u16_strlen(lo->label) + 1) * sizeof(u16);
+	label_len = u16_strsize(lo->label);
 
 	/* total size */
 	size = sizeof(lo->attributes);
-- 
2.34.1



More information about the U-Boot mailing list