From: Renjiang Han Date: Thu, 8 Nov 2018 06:45:50 +0000 (+0800) Subject: ionvideo: Add thread stop protection when the process exits [1/1] X-Git-Tag: khadas-vims-v0.9.6-release~1119 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00c604ba1d2ae0f7b5e3ae585169689a1ea924fd;p=platform%2Fkernel%2Flinux-amlogic.git ionvideo: Add thread stop protection when the process exits [1/1] 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 --- diff --git a/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c b/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c index cd3ad7a..c89143c 100644 --- a/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c +++ b/drivers/amlogic/media/video_processor/ionvideo/ionvideo.c @@ -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");