提交 75c74d1c 编写于 作者: R Robert Krakora 提交者: Mauro Carvalho Chehab

V4L/DVB (11896): em28xx: Fix for Slow Memory Leak

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!!!
Signed-off-by: NRobert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f41b6961
......@@ -339,6 +339,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册