[alsa-devel] [PATCH v2 2/2] topology: Fix the missing referenced elem ptr when merging private data

mengdong.lin at linux.intel.com mengdong.lin at linux.intel.com
Fri Jul 22 03:47:01 CEST 2016


From: Mengdong Lin <mengdong.lin at linux.intel.com>

tplg_copy_data() should set the valid referenced data element pointer
on success. The caller will double check this pointer for all kinds of
references, including controls and data.

Signed-off-by: Mengdong Lin <mengdong.lin at linux.intel.com>

diff --git a/src/topology/data.c b/src/topology/data.c
index 768fc27..e7793b2 100644
--- a/src/topology/data.c
+++ b/src/topology/data.c
@@ -1078,6 +1078,8 @@ int tplg_copy_data(snd_tplg_t *tplg, struct tplg_elem *elem,
 	ref_elem->compound_elem = 1;
 	memcpy(priv->data + old_priv_data_size,
 	       ref_elem->data->data, priv_data_size);
+
+	ref->elem = ref_elem;
 	return 0;
 }
 
-- 
2.5.0



More information about the Alsa-devel mailing list