Skip to content

Commit

Permalink
tee: optee: fix uninitialized symbol 'parg'
Browse files Browse the repository at this point in the history
Fixes the static checker warning in optee_release().
error: uninitialized symbol 'parg'.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
  • Loading branch information
jenswi-linaro authored and Igor Opaniuk committed Jul 5, 2017
1 parent 6af8061 commit 15c3710
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/tee/optee/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,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,
Expand Down

0 comments on commit 15c3710

Please sign in to comment.