[ALSA] hda-intel - Improve HD-audio codec probing robustness
[firefly-linux-kernel-4.4.55.git] / sound / pci / hda / hda_codec.c
index e594de0b153e90102b11939da29042b81e5e12a8..535bcb7601b5bc3dd580ad7ca1ff4a422f10bf06 100644 (file)
@@ -155,6 +155,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid,
        unsigned int parm;
 
        parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT);
+       if (parm == -1)
+               return 0;
        *start_id = (parm >> 16) & 0x7fff;
        return (int)(parm & 0x7fff);
 }