From: Takashi Iwai Subject: Re: [PATCH] ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_type Date: Mon, 14 Mar 2016 08:31:29 +0100 Message-ID: References: <1457931906-23780-1-git-send-email-subhransu.s.prusty@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 121622619BE for ; Mon, 14 Mar 2016 08:31:30 +0100 (CET) In-Reply-To: <1457931906-23780-1-git-send-email-subhransu.s.prusty@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Subhransu S. Prusty" Cc: patches.audio@intel.com, Vinod Koul , alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org On Mon, 14 Mar 2016 06:05:06 +0100, Subhransu S. Prusty wrote: > > 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 > Signed-off-by: Subhransu S. Prusty > Tested-by: Andreas Reis > Signed-off-by: Vinod Koul Applied, thanks. Takashi > --- > sound/pci/hda/patch_hdmi.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c > index f59e87b..a386a65 100644 > --- a/sound/pci/hda/patch_hdmi.c > +++ b/sound/pci/hda/patch_hdmi.c > @@ -2827,8 +2827,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, > -- > 1.9.1 >