diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-07-22 08:56:14 +0300 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-07-22 13:32:41 +0300 |
commit | ebbad02c1b7140f7e9b479586d58aeca03f5350d (patch) | |
tree | e828eec122ad87fc0425104c763c32b1964db5f4 /lib/efi_loader/efi_var_mem.c | |
parent | 01fa922bbbac378902ef85e522724dd7c7a10a8b (diff) | |
download | u-boot-ebbad02c1b7140f7e9b479586d58aeca03f5350d.tar.xz |
efi_loader: don't use memmove() in efi_var_mem_del()
efi_var_mem_del() is in __efi_runtime because it would be needed for a
runtime implementation of SetVariable(). memmove() is not in __efi_runtime.
So we should not use it in efi_var_mem_del().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_var_mem.c')
-rw-r--r-- | lib/efi_loader/efi_var_mem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_var_mem.c b/lib/efi_loader/efi_var_mem.c index 856e5e1d56..bfa8a56a8f 100644 --- a/lib/efi_loader/efi_var_mem.c +++ b/lib/efi_loader/efi_var_mem.c @@ -120,7 +120,8 @@ void __efi_runtime efi_var_mem_del(struct efi_var_entry *var) ALIGN((uintptr_t)data + var->length, 8); efi_var_buf->length -= (uintptr_t)next - (uintptr_t)var; - memmove(var, next, (uintptr_t)last - (uintptr_t)next); + /* efi_memcpy_runtime() can be used because next >= var. */ + efi_memcpy_runtime(var, next, (uintptr_t)last - (uintptr_t)next); efi_var_buf->crc32 = crc32(0, (u8 *)efi_var_buf->var, efi_var_buf->length - sizeof(struct efi_var_file)); |