mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 08:57:58 +00:00
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>
This commit is contained in:
parent
01fa922bbb
commit
ebbad02c1b
2 changed files with 4 additions and 1 deletions
|
@ -144,6 +144,8 @@ efi_status_t efi_init_runtime_supported(void)
|
||||||
*
|
*
|
||||||
* At runtime memcpy() is not available.
|
* At runtime memcpy() is not available.
|
||||||
*
|
*
|
||||||
|
* Overlapping memory areas can be copied safely if src >= dest.
|
||||||
|
*
|
||||||
* @dest: destination buffer
|
* @dest: destination buffer
|
||||||
* @src: source buffer
|
* @src: source buffer
|
||||||
* @n: number of bytes to copy
|
* @n: number of bytes to copy
|
||||||
|
|
|
@ -120,7 +120,8 @@ void __efi_runtime efi_var_mem_del(struct efi_var_entry *var)
|
||||||
ALIGN((uintptr_t)data + var->length, 8);
|
ALIGN((uintptr_t)data + var->length, 8);
|
||||||
efi_var_buf->length -= (uintptr_t)next - (uintptr_t)var;
|
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->crc32 = crc32(0, (u8 *)efi_var_buf->var,
|
||||||
efi_var_buf->length -
|
efi_var_buf->length -
|
||||||
sizeof(struct efi_var_file));
|
sizeof(struct efi_var_file));
|
||||||
|
|
Loading…
Reference in a new issue