tee: fix possible error pointer ctx dereferencing
[sfrench/cifs-2.6.git] / drivers / tee / tee_core.c
index 25f3b9cc8908f44ecb179e540a74ab87fa6721c7..06fbfc044ea33ea0926bb7af3200e2ddb3e48796 100644 (file)
@@ -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);