summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-07-23 05:53:52 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-08-03 07:46:07 +0100
commit4eaac50552395f693b8c428872e8b5311c3dab60 (patch)
treea3211849d447486cdd2051890b12ab3c1fea3d1b
parent6b5d071e8ba7d802f3123e7b7a37ea13650a98bf (diff)
downloadlinux-3.10-4eaac50552395f693b8c428872e8b5311c3dab60.tar.gz
linux-3.10-4eaac50552395f693b8c428872e8b5311c3dab60.tar.bz2
linux-3.10-4eaac50552395f693b8c428872e8b5311c3dab60.zip
ASoC: wm8974: fix a memory leak if another WM8974 is registered
wm8974 is allocated in wm8974_i2c_probe() but is not freed if wm8974_register() return -EINVAL (if another WM8974 is registered). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm8974.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c
index a2c4b2f37cc..1468fe10cbb 100644
--- a/sound/soc/codecs/wm8974.c
+++ b/sound/soc/codecs/wm8974.c
@@ -670,7 +670,8 @@ static __devinit int wm8974_register(struct wm8974_priv *wm8974)
if (wm8974_codec) {
dev_err(codec->dev, "Another WM8974 is registered\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
mutex_init(&codec->mutex);