From bd683566bbdf9eda7b030867aeeb255aa2d1b2dc Mon Sep 17 00:00:00 2001 From: Pengguang Zhu Date: Sun, 5 May 2019 17:37:53 +0800 Subject: [PATCH] linuxdriver: check supplicant status before send message [1/1] PD#TV-5392 Problem: when playing netflix movies, press power button, TV can not power down and console hang. Solution: 1. check supplicant status before send message Test: manual - mm Verify: TXLX + Android P Change-Id: Ia4829ba22de97ee06273632f7b824ddfa5909ee4 Signed-off-by: Pengguang Zhu --- optee/supp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/optee/supp.c b/optee/supp.c index 02b1219..cea1101 100755 --- a/optee/supp.c +++ b/optee/supp.c @@ -88,10 +88,14 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, { struct optee *optee = tee_get_drvdata(ctx->teedev); struct optee_supp *supp = &optee->supp; - struct optee_supp_req *req = kzalloc(sizeof(*req), GFP_KERNEL); + struct optee_supp_req *req = NULL; bool interruptable; u32 ret; + if (!supp->ctx) + return TEEC_ERROR_COMMUNICATION; + + req = kzalloc(sizeof(*req), GFP_KERNEL); if (!req) return TEEC_ERROR_OUT_OF_MEMORY; -- 2.20.1