diff mbox series

[v2,5/6] ASoC: topology: Check return value of pcm_new_ver

Message ID 20200327204729.397-6-amadeuszx.slawinski@linux.intel.com
State Accepted
Commit b3677fc3d68dd942c92de52f0bd9dd8b472a40e6
Headers show
Series ASoC: topology: Propagate error appropriately | expand

Commit Message

Amadeusz Sławiński March 27, 2020, 8:47 p.m. UTC
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>
---

 v2:
  Added this patch

 sound/soc/soc-topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 78d10b9b725b..dade27588e51 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -2135,7 +2135,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 */