aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohit kumar <[email protected]>2020-08-14 16:23:00 +0530
committerMark Brown <[email protected]>2020-08-17 14:39:28 +0100
commit5fd188215d4eb52703600d8986b22311099a5940 (patch)
tree6b21b25c5716abee3a5687a196b6b1f6ab1c09c8
parent784771863abae5f8878c62e9c624111c51bebe7c (diff)
ASoC: qcom: lpass-platform: fix memory leak
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 <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-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 3697f4ee63a0..315feda414d9 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -61,7 +61,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
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;
@@ -118,6 +118,7 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component,
if (v->free_dma_channel)
v->free_dma_channel(drvdata, data->dma_ch);
+ kfree(data);
return 0;
}