diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-12-11 13:07:59 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-01-13 14:36:13 +0300 |
commit | 856fe64da84c95a1d415564b981ae3908eea2a76 (patch) | |
tree | 355d0d808b4ebbd3c3228a531abb7ab195b8d1a3 /sound/soc/codecs | |
parent | 43fb2919d4cb7bf26ffc111a5e8190f8c754c4d2 (diff) | |
download | linux-856fe64da84c95a1d415564b981ae3908eea2a76.tar.xz |
ASoC: cs42l56: fix up error handling in probe
There are two issues with this code. The first error path forgot to set
the error code and instead returns success. The second error path
doesn't clean up.
Fixes: 272b5edd3b8f ("ASoC: Add support for CS42L56 CODEC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X9NE/9nK9/TuxuL+@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/cs42l56.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c index bb9599cc832b..c44a5cdb796e 100644 --- a/sound/soc/codecs/cs42l56.c +++ b/sound/soc/codecs/cs42l56.c @@ -1250,6 +1250,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client, dev_err(&i2c_client->dev, "CS42L56 Device ID (%X). Expected %X\n", devid, CS42L56_DEVID); + ret = -EINVAL; goto err_enable; } alpha_rev = reg & CS42L56_AREV_MASK; @@ -1307,7 +1308,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client, ret = devm_snd_soc_register_component(&i2c_client->dev, &soc_component_dev_cs42l56, &cs42l56_dai, 1); if (ret < 0) - return ret; + goto err_enable; return 0; |