Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1037978imu; Fri, 11 Jan 2019 13:51:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN71J5xS4+Ne5rV7qqspddEwkKdSl6LFmMopjh2RDLB7XgBMiw3+vZ8sNimNqrK74b9wnXvs X-Received: by 2002:a17:902:704b:: with SMTP id h11mr16367970plt.157.1547243480747; Fri, 11 Jan 2019 13:51:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547243480; cv=none; d=google.com; s=arc-20160816; b=QuGzgtOhTX8bC7q4s2zDw009i0SBdcJ0Ou26+tO9QUuyhqG6UlNTugiu3iNUlfoQ45 d/Oxec+rpKbD5F0Q073Xh0f4MNOw84o9spTeQ6PDKog6kkeyQBbsyq6pzC6WxevhTnuw XowkOmrW9O8Jfa9U5dNB2j7+1SONH2jJaMOClerRFbeyk5R0MioAzoJopzJ9yqKX6niO C+H37/+TBaAcS0x+p076BZTtJK0V+5cchmV2vsjBQT0FVhxmAEBi274b0bsDtejgoIId 8YFEF9e/T6pT5Z6QOuhPULn7OUUOp3/8J6wjvUx78uPgNTdGm+XG4JEE9PnWRJbZ4HTe F4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=LNPFI5pc+IP+fdCtJa3Fj3ycaKLBBUhIaWNeqVzLar0=; b=tUPUB9Z/do//OU2QKYLBr/2wxFwyDqMzNiQ1iWtUCRhQOYnGWZogd/ZKqgnMXoe3Il h2JyTie1Ggu4GgcJ0FRm+YTWflxHO+IJXnV7YCTuWzezDNdrxv0/d1d71ZRWlG+54xuP TBjOwE0MdC3esEXjyi59NvRY55iWbAXpLzQ44mXVaSB3bCkV0JScaIvWs1QlJ6ctVL6t 7Aw5WTOqfiVmjj0pL1sdX/AS/83KvHZRPTsAvjvtEYnyGubiFUUKjplPoj7v0AUisE9+ +B/5+cEB1oCvKRrNtALZPGzlY97jlNm2ZJqmsXZqPuWTmxS0luYKk3+dzlW7C1hYsmWa omfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc16si22916244plb.377.2019.01.11.13.51.04; Fri, 11 Jan 2019 13:51:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726198AbfAKVtK (ORCPT + 99 others); Fri, 11 Jan 2019 16:49:10 -0500 Received: from mga14.intel.com ([192.55.52.115]:32825 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbfAKVtK (ORCPT ); Fri, 11 Jan 2019 16:49:10 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2019 13:49:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,466,1539673200"; d="scan'208";a="125243462" Received: from brichar2-mobl.amr.corp.intel.com (HELO [10.251.132.14]) ([10.251.132.14]) by FMSMGA003.fm.intel.com with ESMTP; 11 Jan 2019 13:49:08 -0800 Subject: Re: [alsa-devel] [PATCH] ASoC: soc-core: Fix null pointer dereference in soc_find_component From: Pierre-Louis Bossart To: Rohit kumar , plai@codeaurora.org, bgoswami@codeaurora.org, asishb@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com, srinivas.kandagatla@linaro.org, vinod.koul@linaro.org Cc: Ajit Pandey , Liam Girdwood References: <1547194442-1487-1-git-send-email-rohitkr@codeaurora.org> Message-ID: <4886ed21-65d2-159d-afcd-bb26dcde636e@linux.intel.com> Date: Fri, 11 Jan 2019 15:49:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Thanks for the overnight fix. This update fixes the issue on my > Skylake XPS13 test device (blind testing since I don't understand what > the code does). > > Tested-by: Pierre-Louis Bossart I need to take this back, this set of changes (initial+fix) causes an error with our HDMI support [   17.437684] sof-audio sof-audio: created machine bxt-pcm512x [   17.585279] bxt-pcm512x bxt-pcm512x: ASoC: failed to init link iDisp1 [   17.585639] bxt-pcm512x bxt-pcm512x: snd_soc_register_card failed -517 Removing your changes restores the functionality Adding some traces I can see that the the platform name we use doesn't seem compatible with your logic. All the Intel boards used a constant platform name matching the PCI ID, see e.g. [1], which IIRC is used to bind components. Liam, do you recall in more details if this is really required? [1] https://elixir.bootlin.com/linux/latest/source/sound/soc/intel/boards/bxt_da7219_max98357a.c#L475 [   18.205812] plb: platform name sof-audio [   18.206059] plb: cpu_name (null) [   18.206234] plb: platform name 0000:00:0e.0 [   18.206459] plb: returning -EPROBE_DEFER 1 [   18.206686] bxt-pcm512x bxt-pcm512x: ASoC: failed to init link iDisp1 [   18.207054] bxt-pcm512x bxt-pcm512x: snd_soc_register_card failed -517 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index cbafbdd02483..ae731212f82b 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1133,11 +1133,15 @@ static int soc_init_dai_link(struct snd_soc_card *card,          * Defer card registration if platform dai component is not added to          * component list.          */ +       pr_err("plb: platform name %s\n", link->platform->name);         if (link->platform->of_node || link->platform->name)                 if (!soc_find_component(link->platform->of_node, link->platform->name)) -                       return -EPROBE_DEFER; +                 { +                         pr_err("plb: returning -EPROBE_DEFER 1\n"); +                         return -EPROBE_DEFER; +                 }         /*          * CPU device may be specified by either name or OF node, but          * can be left unspecified, and will be matched based on DAI @@ -1154,9 +1158,14 @@ static int soc_init_dai_link(struct snd_soc_card *card,          * Defer card registration if cpu dai component is not added to          * component list.          */ +       pr_err("plb: cpu_name %s\n", link->cpu_name);         if (link->cpu_of_node || link->cpu_name)                 if (!soc_find_component(link->cpu_of_node, link->cpu_name)) -                       return -EPROBE_DEFER; +                 { +                         pr_err("plb: returning -EPROBE_DEFER 2\n"); +                         return -EPROBE_DEFER; + +                 }         /*          * At least one of CPU DAI name or CPU device name/node must be