Commit 5fd18821 authored by Rohit kumar's avatar Rohit kumar Committed by Mark Brown

ASoC: qcom: lpass-platform: fix memory leak

lpass_pcm_data is never freed. Free it in close
ops to avoid memory leak.

Fixes: 022d00ee ("ASoC: lpass-platform: Fix broken pcm data usage")
Signed-off-by: default avatarRohit kumar <rohitkr@codeaurora.org>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1597402388-14112-5-git-send-email-rohitkr@codeaurora.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 78477186
...@@ -61,7 +61,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component, ...@@ -61,7 +61,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
int ret, dma_ch, dir = substream->stream; int ret, dma_ch, dir = substream->stream;
struct lpass_pcm_data *data; struct lpass_pcm_data *data;
data = devm_kzalloc(soc_runtime->dev, sizeof(*data), GFP_KERNEL); data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
...@@ -118,6 +118,7 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component, ...@@ -118,6 +118,7 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component,
if (v->free_dma_channel) if (v->free_dma_channel)
v->free_dma_channel(drvdata, data->dma_ch); v->free_dma_channel(drvdata, data->dma_ch);
kfree(data);
return 0; return 0;
} }
......
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