diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-09-10 03:39:31 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-09-10 04:26:23 -0400 |
commit | 07dc59f0988cb54fd87bd373b3b27eb2401dd811 (patch) | |
tree | 6cf9ec43ccd20298698cca8aa534d1dae51a7bff | |
parent | 1213a205f9ed27d97de3d5bed28fb085ef4853e2 (diff) |
ALSA: hda - Fix Oops at codec reset/reconfig
snd_hda_codec_reset() calls restore_pincfgs() where the codec is
powered up again, which eventually tries to resume and initialize via
the callbacks of the codec. However, it's the place just after codec
free callback, thus no codec callbacks should be called after that.
On a codec like CS4206, it results in Oops due to the access in init
callback.
This patch fixes the issue by clearing the codec callbacks properly
after freeing codec.
Reported-by: Daniel J Blueman <daniel@quora.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index f25c24c743f9..1c65cc5e3a31 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2353,6 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2353 | } | 2353 | } |
2354 | if (codec->patch_ops.free) | 2354 | if (codec->patch_ops.free) |
2355 | codec->patch_ops.free(codec); | 2355 | codec->patch_ops.free(codec); |
2356 | memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); | ||
2356 | snd_hda_jack_tbl_clear(codec); | 2357 | snd_hda_jack_tbl_clear(codec); |
2357 | codec->proc_widget_hook = NULL; | 2358 | codec->proc_widget_hook = NULL; |
2358 | codec->spec = NULL; | 2359 | codec->spec = NULL; |
@@ -2368,7 +2369,6 @@ int snd_hda_codec_reset(struct hda_codec *codec) | |||
2368 | codec->num_pcms = 0; | 2369 | codec->num_pcms = 0; |
2369 | codec->pcm_info = NULL; | 2370 | codec->pcm_info = NULL; |
2370 | codec->preset = NULL; | 2371 | codec->preset = NULL; |
2371 | memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); | ||
2372 | codec->slave_dig_outs = NULL; | 2372 | codec->slave_dig_outs = NULL; |
2373 | codec->spdif_status_reset = 0; | 2373 | codec->spdif_status_reset = 0; |
2374 | module_put(codec->owner); | 2374 | module_put(codec->owner); |