summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/topology.c
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2023-08-07 16:09:42 -0500
committerMark Brown <broonie@kernel.org>2023-08-07 23:09:32 +0100
commitdefc0c638d20eec17ebb3dbf82709aba1ac2f0d4 (patch)
tree7261a3ca4f2e8bc56390add02d22f3c79850a7c9 /sound/soc/sof/topology.c
parent7a52d7062e02af4a479da24b40cfd76b54c0cd6c (diff)
downloadlinux-stable-defc0c638d20eec17ebb3dbf82709aba1ac2f0d4.tar.gz
linux-stable-defc0c638d20eec17ebb3dbf82709aba1ac2f0d4.tar.bz2
linux-stable-defc0c638d20eec17ebb3dbf82709aba1ac2f0d4.zip
ASoC: SOF: ipc4: avoid uninitialized default instance 0
When a pipeline contains multiple DAI widgets, the pipe_widget is not set up except for the first DAI. This result in the pipe_widget having a default instance 0, which can conflict with another real the pipeline instance 0 and leads to spurious transitions. This patch makes sure the instance_id is properly initialized to a -EINVAL value. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20230807210959.506849-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/topology.c')
-rw-r--r--sound/soc/sof/topology.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 698129dccc7d..1afcbb134d2c 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2157,6 +2157,8 @@ static int sof_complete(struct snd_soc_component *scomp)
struct snd_sof_widget *pipe_widget = spipe->pipe_widget;
struct snd_sof_widget *swidget;
+ pipe_widget->instance_id = -EINVAL;
+
/* Update the scheduler widget's IPC structure */
if (widget_ops && widget_ops[pipe_widget->id].ipc_setup) {
ret = widget_ops[pipe_widget->id].ipc_setup(pipe_widget);