summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_variable_tee.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 5f4aae60bf..94c4de8703 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -100,10 +100,10 @@ static efi_status_t optee_mm_communicate(void *comm_buf, ulong dsize)
param[1].attr = TEE_PARAM_ATTR_TYPE_VALUE_OUTPUT;
rc = tee_invoke_func(conn.tee, &arg, 2, param);
- if (rc)
- return EFI_INVALID_PARAMETER;
tee_shm_free(shm);
tee_close_session(conn.tee, conn.session);
+ if (rc || arg.ret != TEE_SUCCESS)
+ return EFI_DEVICE_ERROR;
switch (param[1].u.value.a) {
case ARM_SVC_SPM_RET_SUCCESS: