aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-02-21 17:53:54 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:01 -0400
commit6da6bf5e43f409672f5525657ff59282e160c59f (patch)
treeaf6a89b17cf83277da2488f8c3e369918f661864
parenteefe1010a4657959588afc7fb3551cfa4e8bb4a7 (diff)
V4L/DVB (10760): cx18: Fix a memory leak of buffers used for sliced VBI insertion
We leaked buffers every time a device was removed, if the user had enabled sliced VBI insertion into the MPEG stream. MythTV uses that. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx18/cx18-driver.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 79b3bf5bcec1..544abbfb843e 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -1066,6 +1066,7 @@ static void cx18_remove(struct pci_dev *pci_dev)
1066{ 1066{
1067 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 1067 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
1068 struct cx18 *cx = to_cx18(v4l2_dev); 1068 struct cx18 *cx = to_cx18(v4l2_dev);
1069 int i;
1069 1070
1070 CX18_DEBUG_INFO("Removing Card\n"); 1071 CX18_DEBUG_INFO("Removing Card\n");
1071 1072
@@ -1095,7 +1096,10 @@ static void cx18_remove(struct pci_dev *pci_dev)
1095 release_mem_region(cx->base_addr, CX18_MEM_SIZE); 1096 release_mem_region(cx->base_addr, CX18_MEM_SIZE);
1096 1097
1097 pci_disable_device(cx->pci_dev); 1098 pci_disable_device(cx->pci_dev);
1098 /* FIXME - we leak cx->vbi.sliced_mpeg_data[i] allocations */ 1099
1100 if (cx->vbi.sliced_mpeg_data[0] != NULL)
1101 for (i = 0; i < CX18_VBI_FRAMES; i++)
1102 kfree(cx->vbi.sliced_mpeg_data[i]);
1099 1103
1100 CX18_INFO("Removed %s\n", cx->card_name); 1104 CX18_INFO("Removed %s\n", cx->card_name);
1101 1105