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>
This commit is contained in:
Ilias Apalodimas 2022-11-10 15:31:30 +02:00 committed by Heinrich Schuchardt
parent 1167e88ab8
commit 94a574d8f6

View file

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