amlvideo2: screenshot buffer leak. [1/1]
authorrenjiang.han <renjiang.han@amlogic.com>
Wed, 24 Jul 2019 11:56:12 +0000 (19:56 +0800)
committerrenjiang.han <renjiang.han@amlogic.com>
Thu, 25 Jul 2019 02:25:54 +0000 (10:25 +0800)
PD#TV-7948

Problem:
Amlvideo2 will not put the last buffer of vdin back.

Solution:
Return temp vf to vdin in amlvideo2.

Verify:
on X301

Change-Id: I6f7f604a8a0fa8f577d50e242968e0aa52450cda
Signed-off-by: renjiang.han <renjiang.han@amlogic.com>
drivers/amlogic/media/video_processor/video_dev/amlvideo2.c

index dd492c5..66a715f 100644 (file)
@@ -4035,7 +4035,14 @@ static int amlvideo2_thread(void *data)
        }
                /*msleep(10);*/
 
-       node->tmp_vf = NULL;
+       if (node->tmp_vf != NULL) {
+               if ((node->recv.name != NULL) &&
+                       (!vf_get_receiver(node->recv.name))) {
+                       vf_put(node->tmp_vf, node->recv.name);
+               }
+               node->tmp_vf = NULL;
+       }
+
        if (amlvideo2_dbg_en) {
                if (node->vid == 0)
                        pr_info("amlvideo2.0 thread exit.\n");