]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: sti: sti_uniperif: add missing error check
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 26 Mar 2021 21:59:18 +0000 (16:59 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 31 Mar 2021 17:03:20 +0000 (18:03 +0100)
commit38d35d9f22b7247f32e5896f42d5fdb7aa3c36ba
tree4ad01bba10fc07dd4df41ea5a68406640c8935d9
parentb96ae6f07c8386aa64eb034ed53812d4cbad3cc8
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>
sound/soc/sti/sti_uniperif.c