]> git.itanic.dy.fi Git - linux-stable/commitdiff
ASoC: topology: Check return value of pcm_new_ver
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 27 Mar 2020 20:47:28 +0000 (16:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2020 08:30:06 +0000 (10:30 +0200)
[ Upstream commit b3677fc3d68dd942c92de52f0bd9dd8b472a40e6 ]

Function pcm_new_ver can fail, so we should check it's return value and
handle possible error.

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-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/soc-topology.c

index 756dd2303106391a1ae2fb235deb80b26014d872..2c6598e07dde3c69d47831b770000ae2288661fc 100644 (file)
@@ -1923,7 +1923,9 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
                        _pcm = pcm;
                } else {
                        abi_match = false;
-                       pcm_new_ver(tplg, pcm, &_pcm);
+                       ret = pcm_new_ver(tplg, pcm, &_pcm);
+                       if (ret < 0)
+                               return ret;
                }
 
                /* create the FE DAIs and DAI links */