linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: rohkumar@qti.qualcomm.com, alsa-devel@alsa-project.org,
	bgoswami@codeaurora.org, vinod.koul@linaro.org,
	linux-kernel@vger.kernel.org, plai@codeaurora.org,
	tiwai@suse.com, lgirdwood@gmail.com,
	Ajit Pandey <ajitp@codeaurora.org>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Rohit kumar <rohitkr@codeaurora.org>,
	asishb@codeaurora.org, srinivas.kandagatla@linaro.org
Subject: Re: [alsa-devel] [PATCH] ASoC: soc-core: Fix null pointer dereference in soc_find_component
Date: Tue, 15 Jan 2019 21:07:16 +0000	[thread overview]
Message-ID: <20190115210716.GI5522@sirena.org.uk> (raw)
In-Reply-To: <796a856c-a9a6-022d-da63-947279090198@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]

On Tue, Jan 15, 2019 at 01:35:07PM -0600, Pierre-Louis Bossart wrote:
> On 1/14/19 6:06 PM, Mark Brown wrote:

> > just pushing the breakage around rather than fixing it.  Can someone
> > with an x86 system take a look and confirm exactly what's going on with
> > binding these cards please?

> Beyond the fact that the platform_name seems to be totally useless,
> additional tests show that the patch ('ASoC: soc-core: defer card probe
> until all component is added to list') adds a new restriction which
> contradicts existing error checks.

Yes...  I'd been coming to the conclusion that it was a huge red herring
here.  

> So if we want to be consistent, the new code should be something like:

> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index b680c673c553..2791da9417f8 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1154,7 +1154,7 @@ static int soc_init_dai_link(struct snd_soc_card
> *card,
>          * Defer card registartion if cpu dai component is not added to
>          * component list.
>          */
> -       if (!soc_find_component(link->cpu_of_node, link->cpu_name))
> +       if (!link->cpu_dai_name && !soc_find_component(link->cpu_of_node,
> link->cpu_name))
>                 return -EPROBE_DEFER;
> 
>         /*

> or try to call soc_find_component with both cpu_name or cpu_dai_name, if
> this makes sense?

I think calling _find_component() makes more sense here as it will do
the check it's actually there thing no matter how the link is
identified.  Assuming that does resolve the issue do you want to make a
patch given that you got there first?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-01-15 21:07 UTC|newest]

Thread overview: 25+ 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
2019-01-12  6:07     ` Rohit kumar
2019-01-14 15:40       ` Liam Girdwood
2019-01-15  0:06     ` Mark Brown
2019-01-15  3:08       ` Pierre-Louis Bossart
2019-01-15 19:35       ` Pierre-Louis Bossart
2019-01-15 21:07         ` Mark Brown [this message]
2019-01-15 21:11         ` Matthias Reichl
2019-01-15 21:16           ` Pierre-Louis Bossart
2019-01-15 21:41             ` Mark Brown
2019-01-15 21:48               ` Matthias Reichl
2019-01-18 23:02             ` Pierre-Louis Bossart
     [not found]               ` <CAOReqxjhZAzOpr-bGcV6uxPsOEid--Ym2Y0YZMHkybgZSePvtQ@mail.gmail.com>
2019-01-19  1:15                 ` Curtis Malainey
2019-01-21 18:30                   ` Mark Brown
2019-01-22 20:11                   ` Pierre-Louis Bossart
2019-01-23  1:36                     ` Curtis Malainey
2019-01-23  2:01                       ` Pierre-Louis Bossart
2019-01-24 18:44                         ` Mark Brown
2019-01-24 19:07                           ` Pierre-Louis Bossart
2019-01-24 19:26                             ` Mark Brown
2019-01-25  1:32                               ` Curtis Malainey
2019-01-21 19:17               ` 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=20190115210716.GI5522@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=ajitp@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=asishb@codeaurora.org \
    --cc=bgoswami@codeaurora.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).