libteec: Fix the initial value of shm->id in teec_pre_process_operation()
teec_pre_process_operation() returns the error code of teec_pre_process_tmpref() directly when it failed (such as allocate a very large size of SHM). In this situation, the shm->id is still zero. It results in the wrong error handling. When TEEC_ReleaseSharedMemory() is called in function teec_free_temp_refs(), it would close a wrong fd 0 since the shm->id is not -1 (the initial value is zero). Reviewed-by:Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
Jerome Forissier <jerome@forissier.org> Signed-off-by:
YJ Chiang <yj.chiang@mediatek.com> Signed-off-by:
Rayan Hu <Rayan.Hu@mediatek.com> Signed-off-by:
JY Ho <JY.Ho@mediatek.com>
Loading
Please register or sign in to comment