summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2017-05-15 11:09:28 +0200
committerVictor Chong <victor.chong@linaro.org>2018-01-12 16:44:44 +0000
commit62275d495b420f40bbc8c33bed80a9647c07bc86 (patch)
tree753602cf6a81149d9a228117541d8738d166cdc0
parent5a7ccb43604c04816491125f306e619ac6f25fb4 (diff)
BACKPORT: tee: optee: fix uninitialized symbol 'parg'
Fixes the static checker warning in optee_release(). error: uninitialized symbol 'parg'. Change-Id: I2eabb31695085cf1e96af8089ca91778bd7ce5a5 Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> (cherry picked from commit efb14036bd7f8914f721e1e82891d4ba617cc784) Signed-off-by: Victor Chong <victor.chong@linaro.org>
-rw-r--r--drivers/tee/optee/core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index 58169e519422..857141e29e80 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -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,