Merge branch 'fix/hda' into topic/hda
authorTakashi Iwai <tiwai@suse.de>
Sun, 19 Jul 2009 11:52:31 +0000 (13:52 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 19 Jul 2009 11:52:31 +0000 (13:52 +0200)
1  2 
sound/pci/hda/hda_codec.c
sound/pci/hda/patch_realtek.c

@@@ -339,14 -327,17 +339,20 @@@ int snd_hda_get_connections(struct hda_
                int range_val;
                hda_nid_t val, n;
  
 -              if (i % num_elems == 0)
 +              if (i % num_elems == 0) {
                        parm = snd_hda_codec_read(codec, nid, 0,
                                                  AC_VERB_GET_CONNECT_LIST, i);
 +                      if (parm == -1 && codec->bus->rirb_error)
 +                              return -EIO;
 +              }
                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 */
Simple merge