diff mbox

ASoC: pcm: fix dpcm_path_put in dpcm runtime update

Message ID 1401882126-26225-1-git-send-email-zhouqiao@marvell.com (mailing list archive)
State Accepted
Commit 7ed9de76ff342cbd717a9cf897044b99272cb8f8
Headers show

Commit Message

Qiao Zhou June 4, 2014, 11:42 a.m. UTC
we need to release dapm widget list after dpcm_path_get in
soc_dpcm_runtime_update. otherwise, there will be potential memory
leak. add dpcm_path_put to fix it.

Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
---
 sound/soc/soc-pcm.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Qiao Zhou June 12, 2014, 6:52 a.m. UTC | #1
On 06/04/2014 07:42 PM, Qiao Zhou wrote:
> we need to release dapm widget list after dpcm_path_get in
> soc_dpcm_runtime_update. otherwise, there will be potential memory
> leak. add dpcm_path_put to fix it.
>
> Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
> ---
>   sound/soc/soc-pcm.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index a391de0..3bb8b80 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -2072,6 +2072,7 @@ int soc_dpcm_runtime_update(struct snd_soc_card *card)
>   			dpcm_be_disconnect(fe, SNDRV_PCM_STREAM_PLAYBACK);
>   		}
>
> +		dpcm_path_put(&list);
>   capture:
>   		/* skip if FE doesn't have capture capability */
>   		if (!fe->cpu_dai->driver->capture.channels_min)
>
Hi Maintainers,

Do you have any comments? Thanks.
Mark Brown June 21, 2014, 10:30 a.m. UTC | #2
On Wed, Jun 04, 2014 at 07:42:06PM +0800, Qiao Zhou wrote:
> we need to release dapm widget list after dpcm_path_get in
> soc_dpcm_runtime_update. otherwise, there will be potential memory
> leak. add dpcm_path_put to fix it.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index a391de0..3bb8b80 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2072,6 +2072,7 @@  int soc_dpcm_runtime_update(struct snd_soc_card *card)
 			dpcm_be_disconnect(fe, SNDRV_PCM_STREAM_PLAYBACK);
 		}
 
+		dpcm_path_put(&list);
 capture:
 		/* skip if FE doesn't have capture capability */
 		if (!fe->cpu_dai->driver->capture.channels_min)