]> git.baikalelectronics.ru Git - uboot.git/commit
efi_loader: Check for the native OP-TEE result on mm_communicate calls
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Wed, 22 Jul 2020 07:32:22 +0000 (10:32 +0300)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 22 Jul 2020 10:32:41 +0000 (12:32 +0200)
commit4f440b91e49afcb9b5be7024ee3be35ae0ea3848
treeb82eced997bba62e83810b80b776bb7501e67f2b
parent985eb2283154025f9016c4336190a0bdbe0fe279
efi_loader: Check for the native OP-TEE result on mm_communicate calls

Currently we only check for the return value of tee_invoke_func().
Although OP-TEE and StMM will correctly set param[1].u.value.a and we'll
eventually return an error, the correct thing to do is check for the
OP_TEE return code as well.
So let's check for that and move tee_shm_free() and tee_close_session()
before exiting with an error to make sure we always clear the registered
memory.

Fixes: eaecd71e96a13 ("efi_loader: Implement EFI variable handling via OP-TEE")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Use EFI_DEVICE_ERROR for TEE communication problems.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_variable_tee.c