summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-12-02 15:29:12 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-21 13:04:50 -0800
commit0f215d5b6bfd70c926569b41e696a35c54fd7bd3 (patch)
treedc7110bce32ea26c4b3d765d1786abe7996e25de
parentd21de8b14ac52b2be0b86435a966aa8e568f853e (diff)
downloadlinux-stable-0f215d5b6bfd70c926569b41e696a35c54fd7bd3.tar.gz
linux-stable-0f215d5b6bfd70c926569b41e696a35c54fd7bd3.tar.bz2
linux-stable-0f215d5b6bfd70c926569b41e696a35c54fd7bd3.zip
ALSA: hda/realtek - Fix Oops in alc_mux_select()
commit cce4aa378a049f4275416ee6302dd24f37b289df upstream. When no imux is available (e.g. a single capture source), alc_auto_init_input_src() may trigger an Oops due to the access to -1. Add a proper zero-check to avoid it. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ba44dc061557..64190957615b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -432,6 +432,8 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
imux = &spec->input_mux[mux_idx];
if (!imux->num_items && mux_idx > 0)
imux = &spec->input_mux[0];
+ if (!imux->num_items)
+ return 0;
type = get_wcaps_type(get_wcaps(codec, nid));
if (type == AC_WID_AUD_MIX) {