Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1328a83 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: core: remove codec from list if registration failed



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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 2db6be6a
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -4096,6 +4096,10 @@ int snd_soc_register_codec(struct device *dev,
	return 0;
	return 0;


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

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