summaryrefslogtreecommitdiff
path: root/drivers/tee/amdtee/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tee/amdtee/core.c')
-rw-r--r--drivers/tee/amdtee/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tee/amdtee/core.c b/drivers/tee/amdtee/core.c
index 0026eb6f13ce..27b4cd77d0db 100644
--- a/drivers/tee/amdtee/core.c
+++ b/drivers/tee/amdtee/core.c
@@ -139,6 +139,9 @@ static struct amdtee_session *find_session(struct amdtee_context_data *ctxdata,
u32 index = get_session_index(session);
struct amdtee_session *sess;
+ if (index >= TEE_NUM_SESSIONS)
+ return NULL;
+
list_for_each_entry(sess, &ctxdata->sess_list, list_node)
if (ta_handle == sess->ta_handle &&
test_bit(index, sess->sess_mask))