From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Lauss Subject: [PATCH] ASoC: fixup oops in generic AC97 codec glue Date: Mon, 4 Jan 2010 16:29:49 +0100 Message-ID: <1262618989-15018-1-git-send-email-manuel.lauss@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by alsa0.perex.cz (Postfix) with ESMTP id 82C3C2459B for ; Mon, 4 Jan 2010 16:27:58 +0100 (CET) Received: by bwz9 with SMTP id 9so24048591bwz.32 for ; Mon, 04 Jan 2010 07:27:57 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Manuel Lauss , alsa-devel@alsa-project.org, pascal@pabr.org List-Id: alsa-devel@alsa-project.org 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. Signed-off-by: Manuel Lauss --- 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(-) diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 69bd0ac..a1bbe16 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -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) -- 1.6.6.rc3