Commit bb342f01 authored by Sumit Garg's avatar Sumit Garg Committed by Arnd Bergmann

tee: fix possible error pointer ctx dereferencing

Add check for valid ctx pointer and then only dereference ctx to
configure supp_nowait flag.

Fixes: 42bf4152 ("tee: add supp_nowait flag in tee_context struct")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSumit Garg <sumit.garg@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 56410c0c
......@@ -993,7 +993,9 @@ tee_client_open_context(struct tee_context *start,
* tee_client_open_session() if any in kernel client requires
* different behaviour.
*/
ctx->supp_nowait = true;
if (!IS_ERR(ctx))
ctx->supp_nowait = true;
return ctx;
}
EXPORT_SYMBOL_GPL(tee_client_open_context);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment