diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-12-02 09:29:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-21 15:57:33 -0500 |
commit | 2a72a47b80bf4dfbdec91889d1d2c4702f134da5 (patch) | |
tree | ac0eff60355aded3d0d4ef4febfba4145e0b9177 /sound | |
parent | 70df35a3564820865db8ddb1b21ef9f92b5ca95c (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e7dc0340da6..eb0a141966a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -509,6 +509,8 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
509 | imux = &spec->input_mux[mux_idx]; | 509 | imux = &spec->input_mux[mux_idx]; |
510 | if (!imux->num_items && mux_idx > 0) | 510 | if (!imux->num_items && mux_idx > 0) |
511 | imux = &spec->input_mux[0]; | 511 | imux = &spec->input_mux[0]; |
512 | if (!imux->num_items) | ||
513 | return 0; | ||
512 | 514 | ||
513 | type = get_wcaps_type(get_wcaps(codec, nid)); | 515 | type = get_wcaps_type(get_wcaps(codec, nid)); |
514 | if (type == AC_WID_AUD_MIX) { | 516 | if (type == AC_WID_AUD_MIX) { |