From 8bf5f9af3b4bafbcb2f515cecc1b71c466aff0fa Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 2 Apr 2022 11:47:01 +0200 Subject: [PATCH] efi_loader: simplify efi_serialize_load_option() Use u16_strsize(). Signed-off-by: Heinrich Schuchardt --- 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.39.5