diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2021-02-19 01:29:16 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-03-10 16:01:58 +0300 |
commit | 4b4f2119f98518c86c5651771ad9db9070c76de4 (patch) | |
tree | f041c662911128f9e29b46d34dd7b84ff0dc1dbb /sound/soc/codecs/lpass-wsa-macro.c | |
parent | 7faaea14feeeb88177ecf8a640a203c319960d43 (diff) | |
download | linux-4b4f2119f98518c86c5651771ad9db9070c76de4.tar.xz |
ASoC: lpass-wsa-macro: add missing test
cppcheck warning:
sound/soc/codecs/lpass-wsa-macro.c:958:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
ret = wsa_macro_set_prim_interpolator_rate(dai, (u8) rate_val, sample_rate);
^
sound/soc/codecs/lpass-wsa-macro.c:946:6: note: ret is assigned
ret = wsa_macro_set_mix_interpolator_rate(dai, (u8) rate_val, sample_rate);
^
sound/soc/codecs/lpass-wsa-macro.c:958:6: note: ret is overwritten
ret = wsa_macro_set_prim_interpolator_rate(dai, (u8) rate_val, sample_rate);
^
set_mix_interpolator_rate can return -EINVAL, add a test and bail on error.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210218222916.89809-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/lpass-wsa-macro.c')
-rw-r--r-- | sound/soc/codecs/lpass-wsa-macro.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c index 9ca49a165f69..e37c8148c0de 100644 --- a/sound/soc/codecs/lpass-wsa-macro.c +++ b/sound/soc/codecs/lpass-wsa-macro.c @@ -944,6 +944,8 @@ static int wsa_macro_set_interpolator_rate(struct snd_soc_dai *dai, goto prim_rate; ret = wsa_macro_set_mix_interpolator_rate(dai, (u8) rate_val, sample_rate); + if (ret < 0) + return ret; prim_rate: /* set primary path sample rate */ for (i = 0; i < ARRAY_SIZE(int_prim_sample_rate_val); i++) { |