From patchwork Mon Mar 14 05:05:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Subhransu S. Prusty" X-Patchwork-Id: 8576341 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BDCDE9F6E1 for ; Mon, 14 Mar 2016 05:05:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C78A22045E for ; Mon, 14 Mar 2016 05:05:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7EDB9203DA for ; Mon, 14 Mar 2016 05:05:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 158E2261687; Mon, 14 Mar 2016 06:05:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 27AB02614BB; Mon, 14 Mar 2016 06:05:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4B8682614C2; Mon, 14 Mar 2016 06:05:21 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by alsa0.perex.cz (Postfix) with ESMTP id 171702612D7 for ; Mon, 14 Mar 2016 06:05:11 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 13 Mar 2016 22:05:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,334,1455004800"; d="scan'208";a="923360389" Received: from subhransu-desktop.iind.intel.com ([10.223.96.24]) by fmsmga001.fm.intel.com with ESMTP; 13 Mar 2016 22:05:01 -0700 From: "Subhransu S. Prusty" To: alsa-devel@alsa-project.org Date: Mon, 14 Mar 2016 10:35:06 +0530 Message-Id: <1457931906-23780-1-git-send-email-subhransu.s.prusty@intel.com> X-Mailer: git-send-email 1.9.1 Cc: tiwai@suse.de, lgirdwood@gmail.com, patches.audio@intel.com, broonie@kernel.org, Vinod Koul , "Subhransu S. Prusty" Subject: [alsa-devel] [PATCH] ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_type X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,