ASoC: sst_platform: add hw_free callback to fix resource leak
authorxingchao <xingchao.wang@intel.com>
Wed, 27 Apr 2011 20:58:54 +0000 (16:58 -0400)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 May 2011 22:29:54 +0000 (23:29 +0100)
Signed-off-by: xingchao <xingchao.wang@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/mid-x86/sst_platform.c

index d567c322a2fb471788d7b8f47345a6b9fd6d5aed..6b1f9d3bf34e2ba37056216fa9635d592435e843 100644 (file)
@@ -376,6 +376,11 @@ static int sst_platform_pcm_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
+static int sst_platform_pcm_hw_free(struct snd_pcm_substream *substream)
+{
+       return snd_pcm_lib_free_pages(substream);
+}
+
 static struct snd_pcm_ops sst_platform_ops = {
        .open = sst_platform_open,
        .close = sst_platform_close,
@@ -384,6 +389,7 @@ static struct snd_pcm_ops sst_platform_ops = {
        .trigger = sst_platform_pcm_trigger,
        .pointer = sst_platform_pcm_pointer,
        .hw_params = sst_platform_pcm_hw_params,
+       .hw_free = sst_platform_pcm_hw_free,
 };
 
 static void sst_pcm_free(struct snd_pcm *pcm)