deinterace: set driver_data to NULL on shutdown release [1/1]
authorJian Cao <jian.cao@amlogic.com>
Mon, 1 Jul 2019 07:15:03 +0000 (15:15 +0800)
committerJian Cao <jian.cao@amlogic.com>
Wed, 3 Jul 2019 09:20:47 +0000 (02:20 -0700)
PD#SWPL-10079

Problem:
use-after-free issue
driver_data is relesed on shutdown, it is used in kthread_di
this thread is not stopped, will return if driver_data is NULL

Solution:
set driver_data to NULL on shutdown release

Verify:
verified on TL1-X301

Change-Id: I64fd1e39e6cedcc801d4d451eb1a56ca2ccc3364
Signed-off-by: Jian Cao <jian.cao@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace.c

index da79e4b..a08118b 100644 (file)
@@ -8554,6 +8554,7 @@ static void di_shutdown(struct platform_device *pdev)
                switch_vpu_clk_gate_vmod(VPU_VPU_CLKB,
                        VPU_CLK_GATE_OFF);
        kfree(di_devp);
+       di_devp = NULL;
        pr_info("[DI] shutdown done.\n");
 
 }