-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: Intel: test w before processing the params_stream callback #5250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -489,6 +489,12 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream, | |
| int ret; | ||
| int i; | ||
|
|
||
| if (!w) { | ||
| dev_err(cpu_dai->dev, "%s widget not found, check amp link num in the topology\n", | ||
| cpu_dai->name); | ||
| return -EINVAL; | ||
| } | ||
|
|
||
| ops = hda_dai_get_ops(substream, cpu_dai); | ||
| if (!ops) { | ||
| dev_err(cpu_dai->dev, "DAI widget ops not set\n"); | ||
|
|
@@ -568,6 +574,12 @@ int sdw_hda_dai_hw_params(struct snd_pcm_substream *substream, | |
| */ | ||
| for_each_rtd_cpu_dais(rtd, i, dai) { | ||
| w = snd_soc_dai_get_widget(dai, substream->stream); | ||
| if (!w) { | ||
| dev_err(cpu_dai->dev, | ||
| "%s widget not found, check amp link num in the topology\n", | ||
| dai->name); | ||
| return -EINVAL; | ||
|
||
| } | ||
| ipc4_copier = widget_to_copier(w); | ||
| memcpy(&ipc4_copier->dma_config_tlv[cpu_dai_id], dma_config_tlv, | ||
| sizeof(*dma_config_tlv)); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.