Unverified Commit 2c91f33c authored by Bard Liao's avatar Bard Liao Committed by Mark Brown
Browse files

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: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarLiam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20250414063239.85200-2-yung-chuan.liao@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8ffd015d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;