summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-07-18 11:48:19 +0200
committerTakashi Iwai <tiwai@suse.de>2009-07-19 13:51:45 +0200
commit2e9bf247066a293ebcd4672ddd487808ab5f2d1b (patch)
tree3cddcbd7842ce3629cc6783d138378cc4fe4f889 /sound
parent9d30937accf2c01e8b0bd59787409a7348cbbcb7 (diff)
downloadlinux-stable-2e9bf247066a293ebcd4672ddd487808ab5f2d1b.tar.gz
linux-stable-2e9bf247066a293ebcd4672ddd487808ab5f2d1b.tar.bz2
linux-stable-2e9bf247066a293ebcd4672ddd487808ab5f2d1b.zip
ALSA: hda_codec: Check for invalid zero connections
To prevent "Too many connections" message and the error path for some HDMI codecs (which makes onboard audio unusable), check for invalid zero connections for CONNECT_LIST verb. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 26d255de6beb..88480c0c58a0 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -332,6 +332,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
AC_VERB_GET_CONNECT_LIST, i);
range_val = !!(parm & (1 << (shift-1))); /* ranges */
val = parm & mask;
+ if (val == 0) {
+ snd_printk(KERN_WARNING "hda_codec: "
+ "invalid CONNECT_LIST verb %x[%i]:%x\n",
+ nid, i, parm);
+ return 0;
+ }
parm >>= shift;
if (range_val) {
/* ranges between the previous and this one */