blob: c7ac38f77c6655eed51c6aaa066bc39f154f147c [file] [log] [blame]
From b81214dea7056c3877aa9eb775557dc4702660ec Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Sun, 12 Dec 2021 17:58:08 +0000
Subject: [PATCH 21/27] Update comm_buf when EFI_BUFFER_TOO_SMALL
When the received buffer is larger than the comm buffer,
the contents of the shared buffer which can fit in the
comm buffer should be read before returning.
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_variable_tee.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 38655a9dbb7c..67743d1f8fce 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -357,6 +357,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
sizeof(size_t);
if (rx_data_size > comm_buf_size) {
+ efi_memcpy_runtime(comm_buf, virt_shared_buf, comm_buf_size);
unmap_sysmem(virt_shared_buf);
return EFI_BUFFER_TOO_SMALL;
}
--
2.30.2