lkml.org 
[lkml]   [2021]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
From


On 23/09/2021 15:58, Pierre-Louis Bossart wrote:
>
>>> +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.

Only the second patch in the PR is applicable for upstream, but it
should be squashed in for v3.

--
Péter

\
 
 \ /
  Last update: 2021-09-23 15:01    [W:2.200 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site