All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Daniel Baluta" <daniel.baluta@oss.nxp.com>,
	broonie@kernel.org
Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com,
	lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
	ranjani.sridharan@linux.intel.com,
	Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	daniel.baluta@nxp.com
Subject: Re: [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
Date: Thu, 23 Sep 2021 07:58:36 -0500	[thread overview]
Message-ID: <b90eff84-b56c-7764-a5bb-f1e07db57cc3@linux.intel.com> (raw)
In-Reply-To: <203bf6cd-6407-f01d-52c3-e399d06cb3f6@linux.intel.com>


>> +static struct sof_ipc_dai_config *hda_dai_update_config(struct snd_soc_dapm_widget *w,
>> +							int channel)
>>  {
>> +	struct snd_sof_widget *swidget = w->dobj.private;
>>  	struct sof_ipc_dai_config *config;
>>  	struct snd_sof_dai *sof_dai;
>> -	struct sof_ipc_reply reply;
>> -	int ret = 0;
>>  
>> -	list_for_each_entry(sof_dai, &hda_stream->sdev->dai_list, list) {
>> -		if (!sof_dai->cpu_dai_name)
>> -			continue;
>> +	if (!swidget) {
>> +		dev_err(swidget->scomp->dev, "error: No private data for widget %s\n", w->name);
> 
> NULL pointer dereference, just return NULL without the print. The caller
> is printing anyways.

yes good catch, we need a v3 with the fixes suggested by Peter in
https://github.com/thesofproject/linux/pull/3171/ applied.

WARNING: multiple messages have this Message-ID (diff)
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Daniel Baluta" <daniel.baluta@oss.nxp.com>,
	broonie@kernel.org
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com,
	linux-kernel@vger.kernel.org, ranjani.sridharan@linux.intel.com,
	lgirdwood@gmail.com, daniel.baluta@nxp.com
Subject: Re: [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
Date: Thu, 23 Sep 2021 07:58:36 -0500	[thread overview]
Message-ID: <b90eff84-b56c-7764-a5bb-f1e07db57cc3@linux.intel.com> (raw)
In-Reply-To: <203bf6cd-6407-f01d-52c3-e399d06cb3f6@linux.intel.com>


>> +static struct sof_ipc_dai_config *hda_dai_update_config(struct snd_soc_dapm_widget *w,
>> +							int channel)
>>  {
>> +	struct snd_sof_widget *swidget = w->dobj.private;
>>  	struct sof_ipc_dai_config *config;
>>  	struct snd_sof_dai *sof_dai;
>> -	struct sof_ipc_reply reply;
>> -	int ret = 0;
>>  
>> -	list_for_each_entry(sof_dai, &hda_stream->sdev->dai_list, list) {
>> -		if (!sof_dai->cpu_dai_name)
>> -			continue;
>> +	if (!swidget) {
>> +		dev_err(swidget->scomp->dev, "error: No private data for widget %s\n", w->name);
> 
> NULL pointer dereference, just return NULL without the print. The caller
> is printing anyways.

yes good catch, we need a v3 with the fixes suggested by Peter in
https://github.com/thesofproject/linux/pull/3171/ applied.

  reply	other threads:[~2021-09-23 12:58 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 14:36 [PATCH v2 00/12] Add support for on demand pipeline setup/destroy Daniel Baluta
2021-09-17 14:36 ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 01/12] ASoC: topology: change the complete op in snd_soc_tplg_ops to return int Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 02/12] ASoC: SOF: control: Add access field in struct snd_sof_control Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 03/12] ASoC: SOF: topology: Add new token for dynamic pipeline Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 04/12] ASoC: SOF: sof-audio: add helpers for widgets, kcontrols and dai config set up Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 05/12] AsoC: dapm: export a couple of functions Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 06/12] ASoC: SOF: Add new fields to snd_sof_route Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 07/12] ASoC: SOF: restore kcontrols for widget during set up Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 08/12] ASoC: SOF: Don't set up widgets during topology parsing Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 09/12] ASoC: SOF: Introduce widget use_count Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-23 12:54   ` Péter Ujfalusi
2021-09-23 12:58     ` Pierre-Louis Bossart [this message]
2021-09-23 12:58       ` Pierre-Louis Bossart
2021-09-23 13:00       ` Péter Ujfalusi
2021-09-23 13:00         ` Péter Ujfalusi
2021-09-24  7:42         ` Daniel Baluta
2021-09-24  7:42           ` Daniel Baluta
2021-09-27  9:09           ` Péter Ujfalusi
2021-09-27  9:09             ` Péter Ujfalusi
2021-09-17 14:36 ` [PATCH v2 11/12] ASoC: SOF: Add support for dynamic pipelines Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 12/12] ASoC: SOF: topology: Add kernel parameter for topology verification Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta

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=b90eff84-b56c-7764-a5bb-f1e07db57cc3@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=daniel.baluta@oss.nxp.com \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    /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.