From: rui guo Date: Thu, 28 Jul 2022 06:13:33 +0000 (+0800) Subject: timer: Widevine V17 oemcrypto_unittest when X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=94f7442b82b52b1ae2394b92920284171b9d8e47;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_optee.git timer: Widevine V17 oemcrypto_unittest when 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 --- diff --git a/optee/rpc.c b/optee/rpc.c index 12ba0cb..038d9e1 100644 --- a/optee/rpc.c +++ b/optee/rpc.c @@ -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;