diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-08-13 11:33:08 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-15 22:28:52 +0900 |
commit | 161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f (patch) | |
tree | 422d4cef906e9fcf84c6af18a2edf5ecc1dcf9e0 /sound/soc/codecs/sta32x.c | |
parent | d2b4c7bd7eabfaa2e3e5b8107d5eeb56ac879813 (diff) | |
download | linux-161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f.tar.bz2 |
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/soc/codecs/sta32x.c')
-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, ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); if (ret != 0) { dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); + kfree(sta32x); return ret; } |