diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-04-17 12:16:05 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-04-17 12:20:42 -0400 |
commit | 594813ffa741b4bcdeff85ca09d734117ac93371 (patch) | |
tree | 057a919c7c7273e144828d7a967d10f87aa68823 /sound/pci/hda/hda_codec.c | |
parent | 83f26ad2c909083fa638d2df1b1a25bcbf2d1be2 (diff) |
ALSA: hda - Don't call vmaster hook when bus->shutdown is set
The flag bus->shutdown implies that the control elements might have
been already destroyed. When a codec is resumed at this state and
tries to call vmaster hook (e.g. in snd_hda_gen_init()), it would
refer to a non-existing object, resulting in Oops in the end.
This patch just adds a check of the flag in the caller side for
avoiding such a crash.
Though, the best would be to clear hook->sw_kctl by the destructor of
the corresponding ctl element, but vmaster uses its own private_free,
it can't be done easily. So let it be for a while.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e37b7388e8aa..3603cbe2d40e 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2784,6 +2784,11 @@ void snd_hda_sync_vmaster_hook(struct hda_vmaster_mute_hook *hook) | |||
2784 | { | 2784 | { |
2785 | if (!hook->hook || !hook->codec) | 2785 | if (!hook->hook || !hook->codec) |
2786 | return; | 2786 | return; |
2787 | /* don't call vmaster hook in the destructor since it might have | ||
2788 | * been already destroyed | ||
2789 | */ | ||
2790 | if (hook->codec->bus->shutdown) | ||
2791 | return; | ||
2787 | switch (hook->mute_mode) { | 2792 | switch (hook->mute_mode) { |
2788 | case HDA_VMUTE_FOLLOW_MASTER: | 2793 | case HDA_VMUTE_FOLLOW_MASTER: |
2789 | snd_ctl_sync_vmaster_hook(hook->sw_kctl); | 2794 | snd_ctl_sync_vmaster_hook(hook->sw_kctl); |