From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761102AbZCPOdG (ORCPT ); Mon, 16 Mar 2009 10:33:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757087AbZCPOcx (ORCPT ); Mon, 16 Mar 2009 10:32:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:42078 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759313AbZCPOcw (ORCPT ); Mon, 16 Mar 2009 10:32:52 -0400 Date: Mon, 16 Mar 2009 15:32:50 +0100 Message-ID: From: Takashi Iwai To: Atsushi Nemoto Cc: Mark Brown , Manuel Lauss , linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: Only deregister AC97 dev if it's name was not "AC97" In-Reply-To: <20090316.232620.95066093.anemo@mba.ocn.ne.jp> References: <20090316.232620.95066093.anemo@mba.ocn.ne.jp> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 16 Mar 2009 23:26:20 +0900 (JST), Atsushi Nemoto wrote: > > The commit 14fa43f53ff3a9c3d8b9662574b7369812a31a97 ("ASoC: Only > register AC97 bus if it's not done already") added a condition for > calling of soc_ac97_dev_register() but not added for calling of > soc_ac97_dev_unregister(). This patch adds same condition for > soc_ac97_dev_unregister(). Without this fix, kernel crashes when > unloading an asoc driver. Hm, codec->ac97->dev.bus should be NULL unless it's registered, so calling soc_ac97_dev_unregister() should be harmless... Maybe I miss something? thanks, Takashi > > Signed-off-by: Atsushi Nemoto > --- > I found this problem when I start debugging a new asoc driver. While > the driver is in very early stage, it should lack many things and have > many bugs. So I'm not sure this is asoc's bug or my driver's bug. > > sound/soc/soc-core.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c > index ec3f8bb..fec57a3 100644 > --- a/sound/soc/soc-core.c > +++ b/sound/soc/soc-core.c > @@ -1435,7 +1435,8 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev) > #ifdef CONFIG_SND_SOC_AC97_BUS > for (i = 0; i < codec->num_dai; i++) { > codec_dai = &codec->dai[i]; > - if (codec_dai->ac97_control && codec->ac97) { > + if (codec_dai->ac97_control && codec->ac97 && > + strcmp(codec->name, "AC97") != 0) { > soc_ac97_dev_unregister(codec); > goto free_card; > } > -- > 1.5.6.3 >