ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_type
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Mon, 14 Mar 2016 05:05:06 +0000 (10:35 +0530)
committerTakashi Iwai <tiwai@suse.de>
Mon, 14 Mar 2016 07:30:47 +0000 (08:30 +0100)
nvhdmi_chmap_cea_alloc_validate_get_type calls itself recursively
using chmap ops causing the double fault.

Fixed by adding the default validate_get_type handling inside nvdia
validate_get_type handler.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=114311
Fixes: 67b90cb ("ALSA: hda - Create common chmap object")
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Tested-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_hdmi.c

index 5fc9ff31b1c5fd913c8e9baf463e1c8456c0a55c..3fc259154c0b562e0d67f99bc2a55fafd590d30f 100644 (file)
@@ -2836,8 +2836,12 @@ static int nvhdmi_chmap_cea_alloc_validate_get_type(struct hdac_chmap *chmap,
        if (cap->ca_index == 0x00 && channels == 2)
                return SNDRV_CTL_TLVT_CHMAP_FIXED;
 
-       return chmap->ops.chmap_cea_alloc_validate_get_type(
-                               chmap, cap, channels);
+       /* If the speaker allocation matches the channel count, it is OK. */
+       if (cap->channels != channels)
+               return -1;
+
+       /* all channels are remappable freely */
+       return SNDRV_CTL_TLVT_CHMAP_VAR;
 }
 
 static int nvhdmi_chmap_validate(struct hdac_chmap *chmap,