Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0443fcfd authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

ASoC: cs42l56: fix up error handling in probe



[ Upstream commit 856fe64da84c95a1d415564b981ae3908eea2a76 ]

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: 272b5edd ("ASoC: Add support for CS42L56 CODEC")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X9NE/9nK9/TuxuL+@mwanda


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 19d54279
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1269,6 +1269,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;
@@ -1324,7 +1325,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client,
	ret =  snd_soc_register_codec(&i2c_client->dev,
			&soc_codec_dev_cs42l56, &cs42l56_dai, 1);
	if (ret < 0)
		return ret;
		goto err_enable;

	return 0;