diff options
author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2020-03-27 16:47:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-10 10:31:22 +0200 |
commit | 0d452c7e309ce2ffa2cd149cd3aa4b7750d52f8b (patch) | |
tree | cdc66a65496cfdee630a0eaddc0d0f2ef7393dde /sound/soc/soc-topology.c | |
parent | 76336d4fa881d101efd1ae9e550348b0c7df90ed (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/soc-topology.c')
-rw-r--r-- | sound/soc/soc-topology.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index efe6ad3bfcd9..e0b40d4d8784 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1283,7 +1283,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); |