[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1279163338.29294.30.camel@mola>
Date: Thu, 15 Jul 2010 11:08:58 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
Guennadi Liakhovetski <g.liakhovetski@....de>,
Tejun Heo <tj@...nel.org>, alsa-devel@...a-project.org
Subject: [PATCH 11/12] wm8978: fix a memory leak if another WM8978 is
registered
wm8978 is allocated in wm8978_i2c_probe() but is not freed if wm8978_register()
return -EINVAL (if another WM8978 is registered).
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
sound/soc/codecs/wm8978.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index 51d5f43..4e80323 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -1007,7 +1007,8 @@ static __devinit int wm8978_register(struct wm8978_priv *wm8978)
if (wm8978_codec) {
dev_err(codec->dev, "Another WM8978 is registered\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto err;
}
/*
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists