summaryrefslogtreecommitdiff
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2023-01-27 15:00:31 +0300
committerMark Brown <broonie@kernel.org>2023-01-27 15:14:13 +0300
commit251a2b11851531526260db1dbc5673a7d6177895 (patch)
tree8453a743cc2372c51db9f9b2e85187db422dfc7e /sound/soc/sof
parentf94f3915274d22d5cd8b253e0533822b934f5f41 (diff)
downloadlinux-251a2b11851531526260db1dbc5673a7d6177895.tar.xz
ASoC: SOF: ipc4-pcm: Do not run the trigger pipelines if no spipe is stored
If the pipeline setup fails at the first widget/pipeline then we will have no spipe stored under the pipeline_list->pipelines, the pipeline_list->count is 0. If this is the case we would have a NULL pointer dereference if the execution is allowed to proceed. Check for this condition along with the pipeline_list->pipelines check Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20230127120031.10709-19-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/ipc4-pcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c
index 2d89d3708ed0..521090d4498d 100644
--- a/sound/soc/sof/ipc4-pcm.c
+++ b/sound/soc/sof/ipc4-pcm.c
@@ -213,7 +213,7 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component,
pipeline_list = &spcm->stream[substream->stream].pipeline_list;
/* nothing to trigger if the list is empty */
- if (!pipeline_list->pipelines)
+ if (!pipeline_list->pipelines || !pipeline_list->count)
return 0;
/* allocate memory for the pipeline data */