[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b8f969a-8f88-2928-0b29-9325451d9613@linaro.org>
Date: Fri, 24 Jul 2020 12:21:45 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Rohit kumar <rohitkr@...eaurora.org>, agross@...nel.org,
bjorn.andersson@...aro.org, lgirdwood@...il.com,
broonie@...nel.org, robh+dt@...nel.org, plai@...eaurora.org,
bgoswami@...eaurora.org, perex@...ex.cz, tiwai@...e.com,
linux-arm-msm@...r.kernel.org, alsa-devel@...a-project.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 04/12] ASoC: qcom: lpass-platform: fix memory leak
On 22/07/2020 11:31, Rohit kumar wrote:
> 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@...eaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
> sound/soc/qcom/lpass-platform.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
> index fb9acfd..b195f3d 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;
> }
>
>
Powered by blists - more mailing lists