aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2022-11-10 15:31:30 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-11-16 08:34:06 +0100
commit94a574d8f6116a12def77fbf9a92f02a430a1d12 (patch)
treefe83aea3c0d080db08e21d695a8cf1e9a76e6477 /lib
parent1167e88ab876febdc1c567e877a6d81996a566a1 (diff)
downloadu-boot-94a574d8f6116a12def77fbf9a92f02a430a1d12.tar.gz
efi_loader: add comments on efi_file_from_path() regarding alignment
UEFI specification requires pointers that are passed to protocol member functions to be aligned. There's a u16_strdup in that function which doesn't make sense otherwise Add a comment so no one removes it accidentally Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 8b9fa5885ae..b1495e58ee0 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -1144,6 +1144,11 @@ struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp)
return NULL;
}
+ /*
+ * UEFI specification requires pointers that are passed to
+ * protocol member functions to be aligned. So memcpy it
+ * unconditionally
+ */
filename = u16_strdup(fdp->str);
if (!filename)
return NULL;