From 23abf87b3184876fe79dfa42a5d8671dcf86f972 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Wed, 16 Jan 2013 11:45:35 +0100 Subject: [PATCH] --- yaml --- r: 353153 b: refs/heads/master c: b56fa1ed09615f148271045d220b1c55580bdfc9 h: refs/heads/master i: 353151: b4862814e833df5976a95ae68eb227506c26f827 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_generic.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 543edcab57f7..3da164ffceaa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ea46c3c87c35b90139b4dca43917d0f605d568ed +refs/heads/master: b56fa1ed09615f148271045d220b1c55580bdfc9 diff --git a/trunk/sound/pci/hda/hda_generic.c b/trunk/sound/pci/hda/hda_generic.c index e878a9effc96..1fa71acc348d 100644 --- a/trunk/sound/pci/hda/hda_generic.c +++ b/trunk/sound/pci/hda/hda_generic.c @@ -2403,8 +2403,16 @@ static int create_input_ctls(struct hda_codec *codec) static struct nid_path *get_input_path(struct hda_codec *codec, int adc_idx, int imux_idx) { struct hda_gen_spec *spec = codec->spec; + if (imux_idx < 0 || imux_idx >= HDA_MAX_NUM_INPUTS) { + snd_BUG(); + return NULL; + } if (spec->dyn_adc_switch) adc_idx = spec->dyn_adc_idx[imux_idx]; + if (adc_idx < 0 || adc_idx >= AUTO_CFG_MAX_OUTS) { + snd_BUG(); + return NULL; + } return snd_hda_get_path_from_idx(codec, spec->input_paths[imux_idx][adc_idx]); }