From: Ranjani Sridharan Date: Sun, 13 Jun 2021 16:18:39 +0000 (-0700) Subject: topology: pre-process-object: dont create if section already exists X-Git-Tag: v1.2.6~31 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=c1f0ec46b42b9b375d8a4ed54ac4478538310a6d;p=alsa-utils.git topology: pre-process-object: dont create if section already exists Skip creating section when it exists already. Signed-off-by: Ranjani Sridharan Signed-off-by: Jaroslav Kysela --- diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c index e476946..c5a132b 100644 --- a/topology/pre-process-object.c +++ b/topology/pre-process-object.c @@ -880,16 +880,18 @@ int tplg_build_object_from_template(struct tplg_pre_processor *tplg_pp, snd_conf *wtop = top; } else { *wtop = tplg_find_config(top, object_name); - if (!(*wtop)) { - ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND, - top); - if (ret < 0) { - SNDERR("Error creating config for %s\n", object_name); - return ret; - } + if (*wtop) + goto template; + + ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND, + top); + if (ret < 0) { + SNDERR("Error creating config for %s\n", object_name); + return ret; } } +template: /* create template config */ if (!map->template_items) return 0;