summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorRohit kumar <rohitkr@codeaurora.org>2020-08-14 16:23:00 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:55:06 +0100
commit39676349044c80cd4376da758ff19a132bee3b89 (patch)
tree9779c037e3a217bd2b4f4cedd543f8c49db66431 /sound
parent6025fe80dce405c04a5f13625bd2edd5bce7a0a2 (diff)
downloadlinux-stable-39676349044c80cd4376da758ff19a132bee3b89.tar.gz
linux-stable-39676349044c80cd4376da758ff19a132bee3b89.tar.bz2
linux-stable-39676349044c80cd4376da758ff19a132bee3b89.zip
ASoC: qcom: lpass-platform: fix memory leak
[ Upstream commit 5fd188215d4eb52703600d8986b22311099a5940 ] lpass_pcm_data is never freed. Free it in close ops to avoid memory leak. Fixes: 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage") Signed-off-by: Rohit kumar <rohitkr@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/1597402388-14112-5-git-send-email-rohitkr@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/qcom/lpass-platform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index d07271ea4c45..2f2967247789 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -69,7 +69,7 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream)
int ret, dma_ch, dir = substream->stream;
struct lpass_pcm_data *data;
- data = devm_kzalloc(soc_runtime->dev, sizeof(*data), GFP_KERNEL);
+ data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
@@ -127,6 +127,7 @@ static int lpass_platform_pcmops_close(struct snd_pcm_substream *substream)
if (v->free_dma_channel)
v->free_dma_channel(drvdata, data->dma_ch);
+ kfree(data);
return 0;
}