BACKPORT: tee: optee: fix uninitialized symbol 'parg'

Fixes the static checker warning in optee_release().
error: uninitialized symbol 'parg'.

Change-Id: I7b183f3b128b3ec6f2154195901a20bd6cf0a838
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit efb14036bd)
Signed-off-by: Victor Chong <victor.chong@linaro.org>
This commit is contained in:
Jens Wiklander
2017-05-15 11:09:28 +02:00
committed by Victor Chong
parent 19e81abf7e
commit 14edc414ca

View File

@@ -224,13 +224,14 @@ static void optee_release(struct tee_context *ctx)
if (!IS_ERR(shm)) {
arg = tee_shm_get_va(shm, 0);
/*
* If va2pa fails for some reason, we can't call
* optee_close_session(), only free the memory. Secure OS
* will leak sessions and finally refuse more sessions, but
* we will at least let normal world reclaim its memory.
* If va2pa fails for some reason, we can't call into
* secure world, only free the memory. Secure OS will leak
* sessions and finally refuse more sessions, but we will
* at least let normal world reclaim its memory.
*/
if (!IS_ERR(arg))
tee_shm_va2pa(shm, arg, &parg);
if (tee_shm_va2pa(shm, arg, &parg))
arg = NULL; /* prevent usage of parg below */
}
list_for_each_entry_safe(sess, sess_tmp, &ctxdata->sess_list,