Skip to content

Commit ffa077b

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc4-topology: Fix input format query of process modules without base extension
If a process module does not have base config extension then the same format applies to all of it's inputs and the process->base_config_ext is NULL, causing NULL dereference when specifically crafted topology and sequences used. Fixes: 648fea1 ("ASoC: SOF: ipc4-topology: set copier output format for process module") Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Seppo Ingalsuo <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Cc: [email protected] Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b062938 commit ffa077b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sound/soc/sof/ipc4-topology.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ sof_ipc4_get_input_pin_audio_fmt(struct snd_sof_widget *swidget, int pin_index)
217217
}
218218

219219
process = swidget->private;
220+
221+
/*
222+
* For process modules without base config extension, base module config
223+
* format is used for all input pins
224+
*/
225+
if (process->init_config != SOF_IPC4_MODULE_INIT_CONFIG_TYPE_BASE_CFG_WITH_EXT)
226+
return &process->base_config.audio_fmt;
227+
220228
base_cfg_ext = process->base_config_ext;
221229

222230
/*

0 commit comments

Comments
 (0)