aboutsummaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2020-03-27 16:47:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 10:32:42 +0200
commita65227855e00e7eac6de44ecc219e1d1cb79f7cb (patch)
tree0d00efcbc9446a3e02ea1ff0eb44e40ac72efe19 /sound/soc
parentce6786add7b6e295c8ab887ea55c96993093e337 (diff)
ASoC: topology: Check soc_tplg_add_route return value
[ Upstream commit 6856e887eae3efc0fe56899cb3f969fe063171c5 ] Function soc_tplg_add_route can propagate error code from callback, we should check its return value and handle fail in correct way. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200327204729.397-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-topology.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index c86c3ea533f6..aa7714f2b78f 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1284,7 +1284,9 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
routes[i]->dobj.index = tplg->index;
list_add(&routes[i]->dobj.list, &tplg->comp->dobj_list);
- soc_tplg_add_route(tplg, routes[i]);
+ ret = soc_tplg_add_route(tplg, routes[i]);
+ if (ret < 0)
+ break;
/* add route, but keep going if some fail */
snd_soc_dapm_add_routes(dapm, routes[i], 1);