diff options
author | Andy Walls <awalls@radix.net> | 2009-02-21 17:53:54 -0500 |
---|---|---|
committer | Andy Walls <awalls@radix.net> | 2009-02-21 17:53:54 -0500 |
commit | 8cf40f59f6981201824308642756f2768065e9da (patch) | |
tree | c0d9d78781ed31a28493555976101d4e3427262f /linux/drivers/media/video/cx18 | |
parent | 97800678699828bf555a960d89f4737c4fc6dad2 (diff) | |
download | mediapointer-dvb-s2-8cf40f59f6981201824308642756f2768065e9da.tar.gz mediapointer-dvb-s2-8cf40f59f6981201824308642756f2768065e9da.tar.bz2 |
cx18: Fix a memory leak of buffers used for sliced VBI insertion
From: Andy Walls <awalls@radix.net>
We leaked buffers every time a device was removed, if the user had enabled
sliced VBI insertion into the MPEG stream. MythTV uses that.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/cx18')
-rw-r--r-- | linux/drivers/media/video/cx18/cx18-driver.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-driver.c b/linux/drivers/media/video/cx18/cx18-driver.c index 58fccd368..8649d5690 100644 --- a/linux/drivers/media/video/cx18/cx18-driver.c +++ b/linux/drivers/media/video/cx18/cx18-driver.c @@ -1073,6 +1073,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"); @@ -1111,7 +1112,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); |