ionvideo: Add thread stop protection when the process exits [1/1]
authorRenjiang Han <renjiang.han@amlogic.com>
Thu, 8 Nov 2018 06:45:50 +0000 (14:45 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 21 Nov 2018 03:25:28 +0000 (19:25 -0800)
PD#SWPL-1689

Problem:
The thread still exists when the process exits

Solution:
Check if the thread exits when the process exits

Verify:
local

Change-Id: I6d805da6bfa0df85b6d39d065c95eed49b3cb7da
Signed-off-by: Renjiang Han <renjiang.han@amlogic.com>
drivers/amlogic/media/video_processor/ionvideo/ionvideo.c

index cd3ad7a..c89143c 100644 (file)
@@ -575,6 +575,11 @@ static int vidioc_close(struct file *file)
 {
        struct ionvideo_dev *dev = video_drvdata(file);
 
+       struct ionvideo_dmaqueue *dma_q = &dev->vidq;
+
+       if (dma_q->kthread)
+               vidioc_streamoff(file, NULL, 0);
+
        IONVID_DBG("vidioc_close!!!!\n");
        ppmgr2_release(&(dev->ppmgr2_dev));
        //dprintk(dev, 2, "vidioc_close\n");