ASoC: SOF: topology: Fix logic for copying tuples
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Fri, 12 May 2023 11:46:30 +0000 (14:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:45 +0000 (17:32 +0100)
commit866c78a3a99b19d431c2abc6d140d3806f4fe31e
tree02a558a8c1f8e5ac7d02f23b599adce3903185e0
parent3e56a1c04882852e3e7d6c59756a16211ebbc457
ASoC: SOF: topology: Fix logic for copying tuples

[ Upstream commit 41c5305cc3d827d2ea686533777a285176ae01a0 ]

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.

Fixes: 7006d20e5e9d ("ASoC: SOF: Introduce IPC3 ops")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230512114630.24439-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/sof/topology.c