Skip to content

Commit

Permalink
ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get…
Browse files Browse the repository at this point in the history
…_type

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 <[email protected]>
Signed-off-by: Subhransu S. Prusty <[email protected]>
Tested-by: Andreas Reis <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Subhransu S. Prusty authored and tiwai committed Mar 14, 2016
1 parent 4061db0 commit 028cb68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 028cb68

Please sign in to comment.