Skip to content

Commit

Permalink
V4L/DVB (10760): cx18: Fix a memory leak of buffers used for sliced V…
Browse files Browse the repository at this point in the history
…BI 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>
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent eefe101 commit 6da6bf5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/video/cx18/cx18-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ static void cx18_remove(struct pci_dev *pci_dev)
{
struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
struct cx18 *cx = to_cx18(v4l2_dev);
int i;

CX18_DEBUG_INFO("Removing Card\n");

Expand Down Expand Up @@ -1095,7 +1096,10 @@ static void cx18_remove(struct pci_dev *pci_dev)
release_mem_region(cx->base_addr, CX18_MEM_SIZE);

pci_disable_device(cx->pci_dev);
/* FIXME - we leak cx->vbi.sliced_mpeg_data[i] allocations */

if (cx->vbi.sliced_mpeg_data[0] != NULL)
for (i = 0; i < CX18_VBI_FRAMES; i++)
kfree(cx->vbi.sliced_mpeg_data[i]);

CX18_INFO("Removed %s\n", cx->card_name);

Expand Down

0 comments on commit 6da6bf5

Please sign in to comment.