summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-audio.c
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@redhat.com>2009-05-28 11:16:19 -0300
committerDouglas Schilling Landgraf <dougsland@redhat.com>2009-05-28 11:16:19 -0300
commit18f456ba66ff7f265cebbc7c0fa00c6ea2d6ae21 (patch)
tree8af258d66c1fed93c0e223fa21eb2581d60a04db /linux/drivers/media/video/em28xx/em28xx-audio.c
parent43d08cbe79b56211fb686f8301d2cfcdaaa1548d (diff)
downloadmediapointer-dvb-s2-18f456ba66ff7f265cebbc7c0fa00c6ea2d6ae21.tar.gz
mediapointer-dvb-s2-18f456ba66ff7f265cebbc7c0fa00c6ea2d6ae21.tar.bz2
em28xx: Fix for Slow Memory Leak
From: Robert Krakora <rob.krakora@messagenetsystems.com> Test Code: (Provided by Douglas) v4l-dvb/v4l2-apps/test/stress-buffer.c The audio DMA area was never being freed and would slowly leak over time as the v4l device was opened and closed by an application. Thanks again to Douglas for generating the test code to help locate memory leaks!!! Priority: normal Signed-off-by: Robert Krakora <rob.krakora@messagenetsystems.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-audio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-audio.c b/linux/drivers/media/video/em28xx/em28xx-audio.c
index 089764d42..66aace7cf 100644
--- a/linux/drivers/media/video/em28xx/em28xx-audio.c
+++ b/linux/drivers/media/video/em28xx/em28xx-audio.c
@@ -385,6 +385,11 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream)
mutex_lock(&dev->lock);
dev->adev.users--;
em28xx_audio_analog_set(dev);
+ if (substream->runtime->dma_area) {
+ dprintk("freeing\n");
+ vfree(substream->runtime->dma_area);
+ substream->runtime->dma_area = NULL;
+ }
mutex_unlock(&dev->lock);
return 0;