diff options
authorJarkko Nikula <jhnikula@gmail.com>2010-12-03 09:18:22 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-03 12:26:42 +0000
commit676ad98a06a629e6273819a54b70f3987044b608 (patch)
parentASoC: Fix inconsistent meaning of default case while checking alc5623->id (diff)
ASoC: Don't oops in soc_probe_aux_dev in case of missing codec
Blind copy of codec finding algorithm from soc_bind_dai_link does not work in soc_probe_aux_dev if matching codec name is not found. In that case the code falls through and tries to start the probing procedure with invalid codec pointer. Fix this and add an error print showing the codec name that cannot be found. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 5720dbcefbc4..2b1fcae4131e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1609,7 +1609,7 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num)
struct snd_soc_pcm_runtime *rtd = &card->rtd_aux[num];
struct snd_soc_codec *codec;
const char *temp;
- int ret = 0;
+ int ret = -ENODEV;
/* find CODEC from registered CODECs*/
list_for_each_entry(codec, &codec_list, list) {
@@ -1620,10 +1620,14 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num)
ret = -EBUSY;
goto out;
- break;
+ goto found;
+ /* codec not found */
+ dev_err(card->dev, "asoc: codec %s not found", aux_dev->codec_name);
+ goto out;
if (!try_module_get(codec->dev->driver->owner))
return -ENODEV;