Commit d2314e0e authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Mark Brown

ASoC: Only deregister AC97 dev if it's name was not "AC97"

The commit 14fa43f5 ("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: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 852fd9e5
...@@ -1432,7 +1432,8 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev) ...@@ -1432,7 +1432,8 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev)
#ifdef CONFIG_SND_SOC_AC97_BUS #ifdef CONFIG_SND_SOC_AC97_BUS
for (i = 0; i < codec->num_dai; i++) { for (i = 0; i < codec->num_dai; i++) {
codec_dai = &codec->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); soc_ac97_dev_unregister(codec);
goto free_card; goto free_card;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment