From: Amadeusz Sławiński Date: Fri, 27 Mar 2020 20:47:28 +0000 (-0400) Subject: ASoC: topology: Check return value of pcm_new_ver X-Git-Tag: v5.4.40~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd8f4a3be50b54d6a9d66d7dfbdb4cd444ff415e;p=platform%2Fkernel%2Flinux-rpi.git ASoC: topology: Check return value of pcm_new_ver [ 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 Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200327204729.397-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index e0b40d4..22960f5 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2092,7 +2092,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 */