Skip to content

Commit

Permalink
ASoC: core: remove codec from list if registration failed
Browse files Browse the repository at this point in the history
Current snd_soc_register_codec() adds codec to list, and calls
snd_soc_register_dais().
But, this listed codec should be removed if dais registration
was failed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Mar 12, 2013
1 parent 2db6be6 commit e1328a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4096,6 +4096,10 @@ int snd_soc_register_codec(struct device *dev,
return 0;

fail_codec_name:
mutex_lock(&client_mutex);
list_del(&codec->list);
mutex_unlock(&client_mutex);

kfree(codec->name);
fail_codec:
kfree(codec);
Expand Down

0 comments on commit e1328a8

Please sign in to comment.