Skip to contentSkip to conversation

ASoC: fixup oops in generic AC97 codec glue

PATCH In review Manuel Lauss 2 participants 2 messages Jan 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: fixup oops in generic AC97 codec glue

Initialize the glue by calling snd_soc_new_ac97_codec() as is done in other ASoC AC97 codecs. Fixes an oops caused by dereferencing uninitialized members in snd_soc_new_pcms().

Run-tested on Au1250.

---
Fixes the oops I reported here:
http://mailman.alsa-project.org/pipermail/alsa-devel/2009-December/023995.html

 sound/soc/codecs/ac97.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sound/soc/codecs/ac97.c +6 -0
index 69bd0ac..a1bbe16 100644
@@ -102,6 +102,12 @@ static int ac97_soc_probe(struct platform_device *pdev)
 	INIT_LIST_HEAD(&codec->dapm_widgets);
 	INIT_LIST_HEAD(&codec->dapm_paths);
 
+	ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
+	if (ret < 0) {
+		printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
+		goto err;
+	}
+
 	/* register pcms */
 	ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
 	if (ret < 0)
Signature · 1 line
1.6.6.rc3
#1 lore raw
Quoted 7 lines · Manuel Lauss

Initialize the glue by calling snd_soc_new_ac97_codec() as is done in other ASoC AC97 codecs. Fixes an oops caused by dereferencing uninitialized members in snd_soc_new_pcms().

Run-tested on Au1250.

Excellent, thanks for tracking this down.