Commit b0f12c61 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 29b4817d
...@@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) ...@@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
dpcm_be_disconnect(fe, stream); dpcm_be_disconnect(fe, stream);
fe->dpcm[stream].runtime = NULL; fe->dpcm[stream].runtime = NULL;
goto fe_err; goto path_err;
} }
dpcm_clear_pending_state(fe, stream); dpcm_clear_pending_state(fe, stream);
...@@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) ...@@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
return 0; return 0;
path_err:
dpcm_path_put(&list);
fe_err: fe_err:
if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown) if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown)
fe->dai_link->compr_ops->shutdown(cstream); fe->dai_link->compr_ops->shutdown(cstream);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment