summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-08-16 06:24:46 -0400
committerMark Brown <broonie@kernel.org>2016-08-16 06:52:31 -0400
commitb0f12c61de013ecb0abe19d5e64bdab45989de5a (patch)
tree3eeb6097e290b8103cc6dd738796eb09630b39c9 /sound
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
After we have called dpcm_path_get we should make sure to call dpcm_path_put on all error paths. This was not happening causing the allocated widget list to be leaked, this patch corrects this by adding a dpcm_path_put to the error path. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-compress.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index d2df46c14c68..bf7b52fce597 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
121 121
122 dpcm_be_disconnect(fe, stream); 122 dpcm_be_disconnect(fe, stream);
123 fe->dpcm[stream].runtime = NULL; 123 fe->dpcm[stream].runtime = NULL;
124 goto fe_err; 124 goto path_err;
125 } 125 }
126 126
127 dpcm_clear_pending_state(fe, stream); 127 dpcm_clear_pending_state(fe, stream);
@@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
136 136
137 return 0; 137 return 0;
138 138
139path_err:
140 dpcm_path_put(&list);
139fe_err: 141fe_err:
140 if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown) 142 if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown)
141 fe->dai_link->compr_ops->shutdown(cstream); 143 fe->dai_link->compr_ops->shutdown(cstream);