Skip to content

Commit

Permalink
ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Charles Keepax authored and Mark Brown committed Aug 16, 2016
1 parent 29b4817 commit b0f12c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/soc-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)

dpcm_be_disconnect(fe, stream);
fe->dpcm[stream].runtime = NULL;
goto fe_err;
goto path_err;
}

dpcm_clear_pending_state(fe, stream);
Expand All @@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)

return 0;

path_err:
dpcm_path_put(&list);
fe_err:
if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown)
fe->dai_link->compr_ops->shutdown(cstream);
Expand Down

0 comments on commit b0f12c6

Please sign in to comment.