Skip to content

Commit 1c0d023

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: topology: Fix tuples array allocation
The memory allocated for the tuples array assumes that there's 1 instance of all tokens already. So for those tokens that have multiple instances in topology, we need to exclude the initial instance that has already been accounted for. Fixes: 4fdef47 ("ASoC: SOF: ipc4-topology: Add new tokens for input/output pin format count") Signed-off-by: Ranjani Sridharan <[email protected] Reviewed-by: Pierre-Louis Bossart <[email protected] Reviewed-by: Bard Liao <[email protected] Signed-off-by: Peter Ujfalusi <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent be3c215 commit 1c0d023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sof/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ static int sof_widget_parse_tokens(struct snd_soc_component *scomp, struct snd_s
12651265
if (num_sets > 1) {
12661266
struct snd_sof_tuple *new_tuples;
12671267

1268-
num_tuples += token_list[object_token_list[i]].count * num_sets;
1268+
num_tuples += token_list[object_token_list[i]].count * (num_sets - 1);
12691269
new_tuples = krealloc(swidget->tuples,
12701270
sizeof(*new_tuples) * num_tuples, GFP_KERNEL);
12711271
if (!new_tuples) {

0 commit comments

Comments
 (0)