efi_loader: simplify efi_serialize_load_option()

Use u16_strsize().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt 2022-04-02 11:47:01 +02:00
parent b27d8e4037
commit 8bf5f9af3b

View file

@ -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);