Commit 9ab88434 authored by xingchao's avatar xingchao Committed by Mark Brown

ASoC: sst_platform: add hw_free callback to fix resource leak

Signed-off-by: default avatarxingchao <xingchao.wang@intel.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent ed77cc12
...@@ -376,6 +376,11 @@ static int sst_platform_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -376,6 +376,11 @@ static int sst_platform_pcm_hw_params(struct snd_pcm_substream *substream,
return 0; 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 = { static struct snd_pcm_ops sst_platform_ops = {
.open = sst_platform_open, .open = sst_platform_open,
.close = sst_platform_close, .close = sst_platform_close,
...@@ -384,6 +389,7 @@ static struct snd_pcm_ops sst_platform_ops = { ...@@ -384,6 +389,7 @@ static struct snd_pcm_ops sst_platform_ops = {
.trigger = sst_platform_pcm_trigger, .trigger = sst_platform_pcm_trigger,
.pointer = sst_platform_pcm_pointer, .pointer = sst_platform_pcm_pointer,
.hw_params = sst_platform_pcm_hw_params, .hw_params = sst_platform_pcm_hw_params,
.hw_free = sst_platform_pcm_hw_free,
}; };
static void sst_pcm_free(struct snd_pcm *pcm) static void sst_pcm_free(struct snd_pcm *pcm)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment