linuxdriver: check supplicant status before send message [1/1]
authorPengguang Zhu <pengguang.zhu@amlogic.com>
Sun, 5 May 2019 09:37:53 +0000 (17:37 +0800)
committerPengguang Zhu <pengguang.zhu@amlogic.com>
Sun, 5 May 2019 09:40:10 +0000 (17:40 +0800)
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 <pengguang.zhu@amlogic.com>
optee/supp.c

index 02b1219b581dc4bfc1b940fb81efc6e88483cd99..cea1101362813fa47ad6c3848b71acf33782dba7 100755 (executable)
@@ -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;