]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
2fff9b81a75ca9c52d6f3b3df64f9dc5cae67ab8
[thirdparty/kernel/stable-queue.git] /
1 From ffa077b2f6ad124ec3d23fbddc5e4b0ff2647af8 Mon Sep 17 00:00:00 2001
2 From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
3 Date: Wed, 29 May 2024 15:12:01 +0300
4 Subject: ASoC: SOF: ipc4-topology: Fix input format query of process modules without base extension
5
6 From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
7
8 commit ffa077b2f6ad124ec3d23fbddc5e4b0ff2647af8 upstream.
9
10 If a process module does not have base config extension then the same
11 format applies to all of it's inputs and the process->base_config_ext is
12 NULL, causing NULL dereference when specifically crafted topology and
13 sequences used.
14
15 Fixes: 648fea128476 ("ASoC: SOF: ipc4-topology: set copier output format for process module")
16 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
17 Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
18 Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
19 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
20 Cc: stable@vger.kernel.org
21 Link: https://msgid.link/r/20240529121201.14687-1-peter.ujfalusi@linux.intel.com
22 Signed-off-by: Mark Brown <broonie@kernel.org>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 ---
25 sound/soc/sof/ipc4-topology.c | 8 ++++++++
26 1 file changed, 8 insertions(+)
27
28 --- a/sound/soc/sof/ipc4-topology.c
29 +++ b/sound/soc/sof/ipc4-topology.c
30 @@ -195,6 +195,14 @@ sof_ipc4_get_input_pin_audio_fmt(struct
31 }
32
33 process = swidget->private;
34 +
35 + /*
36 + * For process modules without base config extension, base module config
37 + * format is used for all input pins
38 + */
39 + if (process->init_config != SOF_IPC4_MODULE_INIT_CONFIG_TYPE_BASE_CFG_WITH_EXT)
40 + return &process->base_config.audio_fmt;
41 +
42 base_cfg_ext = process->base_config_ext;
43
44 /*