Skip to content

Commit 57d1c63

Browse files
ranj063plbossart
authored andcommitted
ASoC: SOF: topology: Fix logic for copying tuples
Topology could have more instances of the tokens being searched for than the number of sets that need to be copied. Stop copying token after the limit of number of token instances has been reached. This worked before only by chance as we had allocated more size for the tuples array than the number of actual tokens being parsed. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 132e4a7 commit 57d1c63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/sof/topology.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ static int sof_copy_tuples(struct snd_sof_dev *sdev, struct snd_soc_tplg_vendor_
586586
if (*num_copied_tuples == tuples_size)
587587
return 0;
588588
}
589+
590+
/* stop when we've found the required token instances */
591+
if (found == num_tokens * token_instance_num)
592+
return 0;
589593
}
590594

591595
/* next array */

0 commit comments

Comments
 (0)