[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1290386048.6941.6.camel@mola>
Date: Mon, 22 Nov 2010 08:34:07 +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>,
Arnaud Patard <arnaud.patard@...-net.org>
Subject: [PATCH] ASoC: Fix a memory leak in alc5623_i2c_probe error path
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
sound/soc/codecs/alc5623.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index 5a45067..3315cdc 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -1023,10 +1023,8 @@ static int alc5623_i2c_probe(struct i2c_client *client,
dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2);
alc5623 = kzalloc(sizeof(struct alc5623_priv), GFP_KERNEL);
- if (alc5623 == NULL) {
- ret = -ENOMEM;
- goto err;
- }
+ if (alc5623 == NULL)
+ return -ENOMEM;
pdata = client->dev.platform_data;
if (pdata) {
@@ -1057,12 +1055,9 @@ static int alc5623_i2c_probe(struct i2c_client *client,
&soc_codec_device_alc5623, &alc5623_dai, 1);
if (ret != 0) {
dev_err(&client->dev, "Failed to register codec: %d\n", ret);
- goto err;
+ kfree(alc5623);
}
- return 0;
-
-err:
return ret;
}
--
1.7.0.4
--
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