timer: Widevine V17 oemcrypto_unittest when
authorrui guo <rui.guo@amlogic.com>
Thu, 28 Jul 2022 06:13:33 +0000 (14:13 +0800)
committerBruno Martins <bgcngm@gmail.com>
Sat, 20 Jul 2024 21:21:43 +0000 (22:21 +0100)
running on OHM, press CTRL + C to crash [1/1]

PD#SWPL-88689

Problem:
Widevine V17 oemcrypto_unittest when running on
OHM, press CTRL + C to crash

Solution:
When the context is released in the timer
interrupt, it will return

Verify:
Android T + AH212

Change-Id: I02959fd798ad85d7cab410a7a5988f9fffe14273
Signed-off-by: rui guo <rui.guo@amlogic.com>
optee/rpc.c

index 12ba0cb3d54635eeca8469fa4316361a0323f5b2..038d9e10cec2dee94b416eea9682e924de3c923a 100644 (file)
@@ -333,11 +333,20 @@ static void timer_work_task(struct work_struct *work)
                        struct optee_timer_data, work);
        struct tee_context *ctx = timer_data->ctx;
        struct tee_device *teedev = ctx->teedev;
-       struct optee *optee = tee_get_drvdata(teedev);
-       struct optee_timer *timer = &optee->timer;
-       struct workqueue_struct *wq = timer->wq;
+       struct optee *optee = NULL;
+       struct optee_timer *timer = NULL;
+       struct workqueue_struct *wq = NULL;
        int ret = 0;
 
+       optee = tee_get_drvdata(teedev);
+       if (!optee) {
+               pr_err("Can't find teedev!\n");
+               return;
+       }
+
+       timer = &optee->timer;
+       wq = timer->wq;
+
        params[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT;
        params[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_NONE;
        params[2].attr = TEE_IOCTL_PARAM_ATTR_TYPE_NONE;