All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Rohit kumar <rohitkr@codeaurora.org>,
	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 <ajitp@codeaurora.org>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>
Subject: Re: [alsa-devel] [PATCH] ASoC: soc-core: Fix null pointer dereference in soc_find_component
Date: Fri, 11 Jan 2019 15:49:08 -0600	[thread overview]
Message-ID: <4886ed21-65d2-159d-afcd-bb26dcde636e@linux.intel.com> (raw)
In-Reply-To: <d8726e9a-3477-a573-8c1a-dd8245068802@linux.intel.com>


> 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 <pierre-louis.bossart@linux.intel.com>

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


  reply	other threads:[~2019-01-11 21:49 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  8:14 [PATCH] ASoC: soc-core: Fix null pointer dereference in soc_find_component Rohit kumar
2019-01-11 15:44 ` [alsa-devel] " Pierre-Louis Bossart
2019-01-11 21:49   ` Pierre-Louis Bossart [this message]
2019-01-12  6:07     ` Rohit kumar
2019-01-12  6:07       ` Rohit kumar
2019-01-14 15:40       ` [alsa-devel] " Liam Girdwood
2019-01-15  0:06     ` Mark Brown
2019-01-15  0:06       ` Mark Brown
2019-01-15  3:08       ` [alsa-devel] " Pierre-Louis Bossart
2019-01-15  3:08         ` Pierre-Louis Bossart
2019-01-15 19:35       ` [alsa-devel] " Pierre-Louis Bossart
2019-01-15 21:07         ` Mark Brown
2019-01-15 21:07           ` Mark Brown
2019-01-15 21:11         ` [alsa-devel] " Matthias Reichl
2019-01-15 21:11           ` Matthias Reichl
2019-01-15 21:16           ` [alsa-devel] " Pierre-Louis Bossart
2019-01-15 21:41             ` Mark Brown
2019-01-15 21:41               ` Mark Brown
2019-01-15 21:48               ` [alsa-devel] " Matthias Reichl
2019-01-18 23:02             ` Pierre-Louis Bossart
2019-01-19  1:12               ` Curtis Malainey
2019-01-19  1:15                 ` [alsa-devel] " Curtis Malainey
2019-01-21 18:30                   ` Mark Brown
2019-01-22 20:11                   ` Pierre-Louis Bossart
2019-01-22 20:11                     ` Pierre-Louis Bossart
2019-01-23  1:36                     ` [alsa-devel] " Curtis Malainey
2019-01-23  2:01                       ` Pierre-Louis Bossart
2019-01-23  2:01                         ` Pierre-Louis Bossart
2019-01-24 18:44                         ` Mark Brown
2019-01-24 18:44                           ` Mark Brown
2019-01-24 19:07                           ` [alsa-devel] " Pierre-Louis Bossart
2019-01-24 19:26                             ` Mark Brown
2019-01-24 19:26                               ` Mark Brown
2019-01-25  1:32                               ` [alsa-devel] " Curtis Malainey
2019-01-25  1:32                                 ` Curtis Malainey
2019-01-21 19:17               ` [alsa-devel] " Mark Brown
2019-01-21 19:17                 ` Mark Brown
2019-01-14 23:26 ` Mark Brown
2019-01-14 23:26   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4886ed21-65d2-159d-afcd-bb26dcde636e@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=ajitp@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=asishb@codeaurora.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=plai@codeaurora.org \
    --cc=rohitkr@codeaurora.org \
    --cc=rohkumar@qti.qualcomm.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.