[media] cx231xx: Fix memory leak

dma_area needs to be freed when the device is closed.

Based on em23xx-audio.c

Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Jean-Baptiste Theou 2016-01-08 20:02:03 -02:00 committed by Mauro Carvalho Chehab
parent aeae69daa3
commit 9dd73448c6
1 changed files with 5 additions and 0 deletions

View File

@ -499,6 +499,11 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
}
dev->adev.users--;
if (substream->runtime->dma_area) {
dev_dbg(dev->dev, "freeing\n");
vfree(substream->runtime->dma_area);
substream->runtime->dma_area = NULL;
}
mutex_unlock(&dev->lock);
if (dev->adev.users == 0 && dev->adev.shutdown == 1) {