linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Vladimir Barinov <vbarinov@embeddedalley.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 3/5] ASoC: Fix incorrect kfree in aic3x_probe error path
Date: Tue, 16 Nov 2010 16:09:41 +0800	[thread overview]
Message-ID: <1289894981.19543.8.camel@mola> (raw)
In-Reply-To: <1289894931.19543.6.camel@mola>

We allocated memory for aic3x in aic3x_i2c_probe,
and will free the memory in either aic3x_i2c_probe error path or
aic3x_i2c_remove.

Thus we should not call kfree(aic3x) in aic3x_probe, otherwise
we have double free of aic3x.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/tlv320aic3x.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 6173c2b..df726a5 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1419,7 +1419,6 @@ err_get:
 	if (aic3x->gpio_reset >= 0)
 		gpio_free(aic3x->gpio_reset);
 err_gpio:
-	kfree(aic3x);
 	return ret;
 }
 
-- 
1.7.2




  reply	other threads:[~2010-11-16  8:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16  8:06 [PATCH 0/5] ASoC: Fix incorrect kfree in error path Axel Lin
2010-11-16  8:08 ` [PATCH 1/5] ASoC: Fix incorrect kfree in ad1836_probe " Axel Lin
2010-11-16  8:08   ` [PATCH 2/5] ASoC: Fix incorrect kfree in ad193x_probe " Axel Lin
2010-11-16  8:09     ` Axel Lin [this message]
2010-11-16  8:10       ` [PATCH 4/5] ASoC: Fix incorrect kfree in wm8731_probe " Axel Lin
2010-11-16  8:11         ` [PATCH 5/5] ASoC: Fix incorrect kfree in wm8962_probe " Axel Lin
2010-11-16  9:52 ` [PATCH 0/5] ASoC: Fix incorrect kfree in " Liam Girdwood
2010-11-16 11:37   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289894981.19543.8.camel@mola \
    --to=axel.lin@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=vbarinov@embeddedalley.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).