aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart2021-03-26 16:59:18 -0500
committerMark Brown2021-03-31 18:03:20 +0100
commitbf2a6b44d5e56a12dde6438a2d092475e54d1923 (patch)
tree4ad01bba10fc07dd4df41ea5a68406640c8935d9
parent00a25480cca4a094765084964c753c8f28e0f6fd (diff)
ASoC: sti: sti_uniperif: add missing error check
cppcheck warning: sound/soc/sti/sti_uniperif.c:490:6: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] ret = devm_snd_soc_register_component(&pdev->dev, ^ sound/soc/sti/sti_uniperif.c:486:6: note: ret is assigned ret = sti_uniperiph_cpu_dai_of(node, priv); ^ sound/soc/sti/sti_uniperif.c:490:6: note: ret is overwritten ret = devm_snd_soc_register_component(&pdev->dev, ^ sti_uniperiph_cpu_dai_of() can return -EINVAL which seems like a good-enough reason to bail. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20210326215927.936377-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sti/sti_uniperif.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c
index 7b9169f04d6e..67315d9b352d 100644
--- a/sound/soc/sti/sti_uniperif.c
+++ b/sound/soc/sti/sti_uniperif.c
@@ -484,6 +484,8 @@ static int sti_uniperiph_probe(struct platform_device *pdev)
priv->pdev = pdev;
ret = sti_uniperiph_cpu_dai_of(node, priv);
+ if (ret < 0)
+ return ret;
dev_set_drvdata(&pdev->dev, priv);