From patchwork Sun Mar 22 09:35:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 244080 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Sun, 22 Mar 2020 10:35:30 +0100 Subject: [PATCH 1/1] efi_loader: fix freestanding memmove() Message-ID: <20200322093530.70034-1-xypron.glpk@gmx.de> For EFI binaries we have to provide an implementation of memmove() in efi_freestanding.c. Before this patch the memmove() function was copying in the wrong direction. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_freestanding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/lib/efi_loader/efi_freestanding.c b/lib/efi_loader/efi_freestanding.c index dcf5d1c49a..bd0dff162f 100644 --- a/lib/efi_loader/efi_freestanding.c +++ b/lib/efi_loader/efi_freestanding.c @@ -47,7 +47,7 @@ void *memmove(void *dest, const void *src, size_t n) u8 *d = dest; const u8 *s = src; - if (d >= s) { + if (d <= s) { for (; n; --n) *d++ = *s++; } else {