diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-08-12 23:33:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-15 09:28:52 -0400 |
commit | 161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f (patch) | |
tree | 422d4cef906e9fcf84c6af18a2edf5ecc1dcf9e0 /sound | |
parent | d2b4c7bd7eabfaa2e3e5b8107d5eeb56ac879813 (diff) |
ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/sta32x.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index 409d89d1f34c..fbd7eb9e61ce 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c | |||
@@ -857,6 +857,7 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c, | |||
857 | ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); | 857 | ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); |
858 | if (ret != 0) { | 858 | if (ret != 0) { |
859 | dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); | 859 | dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); |
860 | kfree(sta32x); | ||
860 | return ret; | 861 | return ret; |
861 | } | 862 | } |
862 | 863 | ||