diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-03-16 10:26:20 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-17 09:59:47 -0400 |
commit | d2314e0e27566f8830ebed3587cc049e07e6a4ee (patch) | |
tree | 14f27f22f0725f123c8882fe463db414cb3e5fda /sound/soc/soc-core.c | |
parent | 852fd9e50f62b4ea7afe26eee0710464de4801b8 (diff) |
ASoC: Only deregister AC97 dev if it's name was not "AC97"
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.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | 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 16518329f6b2..6e710f705a74 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1432,7 +1432,8 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev) | |||
1432 | #ifdef CONFIG_SND_SOC_AC97_BUS | 1432 | #ifdef CONFIG_SND_SOC_AC97_BUS |
1433 | for (i = 0; i < codec->num_dai; i++) { | 1433 | for (i = 0; i < codec->num_dai; i++) { |
1434 | codec_dai = &codec->dai[i]; | 1434 | codec_dai = &codec->dai[i]; |
1435 | if (codec_dai->ac97_control && codec->ac97) { | 1435 | if (codec_dai->ac97_control && codec->ac97 && |
1436 | strcmp(codec->name, "AC97") != 0) { | ||
1436 | soc_ac97_dev_unregister(codec); | 1437 | soc_ac97_dev_unregister(codec); |
1437 | goto free_card; | 1438 | goto free_card; |
1438 | } | 1439 | } |