diff options
author | Bard Liao <yung-chuan.liao@linux.intel.com> | 2025-04-14 14:32:29 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-04-14 11:22:16 +0100 |
commit | 2c91f33c72db65a053e1aedfd662c1c984fb4c02 (patch) | |
tree | c63e543260d575625277c7273948c401f1d01721 | |
parent | 8ffd015db85fea3e15a77027fda6c02ced4d2444 (diff) |
ASoC: SOF: topology: allocate string for tuples
In preparation to handle tuples from multiple topologies, duplicate the
tuple string value by allocating memory for it.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250414063239.85200-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sof/topology.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index dc9cb8324067..15e8ca62ab14 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -571,7 +571,11 @@ static int sof_copy_tuples(struct snd_sof_dev *sdev, struct snd_soc_tplg_vendor_ continue; tuples[*num_copied_tuples].token = tokens[j].token; - tuples[*num_copied_tuples].value.s = elem->string; + tuples[*num_copied_tuples].value.s = + devm_kasprintf(sdev->dev, GFP_KERNEL, + "%s", elem->string); + if (!tuples[*num_copied_tuples].value.s) + return -ENOMEM; } else { struct snd_soc_tplg_vendor_value_elem *elem; |