This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: tw686x: Fix memory leak in tw686x_video_init
Author:  Miaoqian Lin <[email protected]>
Date:    Tue Jun 21 06:30:30 2022 +0100

video_device_alloc() allocates memory for vdev,
when video_register_device() fails, it doesn't release the memory and
leads to memory leak, call video_device_release() to fix this.

Fixes: 704a84ccdbf1 ("[media] media: Support Intersil/Techwell TW686x-based 
video capture cards")
Signed-off-by: Miaoqian Lin <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/pci/tw686x/tw686x-video.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/pci/tw686x/tw686x-video.c 
b/drivers/media/pci/tw686x/tw686x-video.c
index 6344a479119f..3ebf7a2c95f0 100644
--- a/drivers/media/pci/tw686x/tw686x-video.c
+++ b/drivers/media/pci/tw686x/tw686x-video.c
@@ -1280,8 +1280,10 @@ int tw686x_video_init(struct tw686x_dev *dev)
                video_set_drvdata(vdev, vc);
 
                err = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
-               if (err < 0)
+               if (err < 0) {
+                       video_device_release(vdev);
                        goto error;
+               }
                vc->num = vdev->num;
        }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to