All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Fix a memory leak in alc5623_i2c_probe error path
@ 2010-11-22  0:34 Axel Lin
  2010-11-22 20:31 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-11-22  0:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Arnaud Patard

Signed-off-by: Axel Lin <axel.lin@gmail.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




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: Fix a memory leak in alc5623_i2c_probe error path
  2010-11-22  0:34 [PATCH] ASoC: Fix a memory leak in alc5623_i2c_probe error path Axel Lin
@ 2010-11-22 20:31 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-11-22 20:31 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Liam Girdwood, Arnaud Patard

On Mon, Nov 22, 2010 at 08:34:07AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-22 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22  0:34 [PATCH] ASoC: Fix a memory leak in alc5623_i2c_probe error path Axel Lin
2010-11-22 20:31 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.