lkml.org 
[lkml]   [2009]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: Only deregister AC97 dev if it's name was not "AC97"
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 <anemo@mba.ocn.ne.jp>
> ---
> 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
>


\
 
 \ /
  Last update: 2009-03-16 15:35    [W:0.070 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site