aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-11-21 19:34:07 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-22 15:31:14 -0500
commitc7b642911ea0fa9168425757752f094a1255209a (patch)
tree545df774e48939afd721d02a4d0b38f6695bb531
parent851cad5aa11a0692c4c92ebbfa94d06564034dcc (diff)
ASoC: Fix a memory leak in alc5623_i2c_probe error path
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/alc5623.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index e84b26b0ce9e..9783e7e2eb93 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -1022,10 +1022,8 @@ static int alc5623_i2c_probe(struct i2c_client *client,
1022 dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); 1022 dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2);
1023 1023
1024 alc5623 = kzalloc(sizeof(struct alc5623_priv), GFP_KERNEL); 1024 alc5623 = kzalloc(sizeof(struct alc5623_priv), GFP_KERNEL);
1025 if (alc5623 == NULL) { 1025 if (alc5623 == NULL)
1026 ret = -ENOMEM; 1026 return -ENOMEM;
1027 goto err;
1028 }
1029 1027
1030 pdata = client->dev.platform_data; 1028 pdata = client->dev.platform_data;
1031 if (pdata) { 1029 if (pdata) {
@@ -1056,12 +1054,9 @@ static int alc5623_i2c_probe(struct i2c_client *client,
1056 &soc_codec_device_alc5623, &alc5623_dai, 1); 1054 &soc_codec_device_alc5623, &alc5623_dai, 1);
1057 if (ret != 0) { 1055 if (ret != 0) {
1058 dev_err(&client->dev, "Failed to register codec: %d\n", ret); 1056 dev_err(&client->dev, "Failed to register codec: %d\n", ret);
1059 goto err; 1057 kfree(alc5623);
1060 } 1058 }
1061 1059
1062 return 0;
1063
1064err:
1065 return ret; 1060 return ret;
1066} 1061}
1067 1062