summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-08-13 11:33:08 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-15 22:28:52 +0900
commit161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f (patch)
tree422d4cef906e9fcf84c6af18a2edf5ecc1dcf9e0 /sound
parentd2b4c7bd7eabfaa2e3e5b8107d5eeb56ac879813 (diff)
downloadlinux-3.10-161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f.tar.gz
linux-3.10-161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f.tar.bz2
linux-3.10-161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f.zip
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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 409d89d1f34..fbd7eb9e61c 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;
}