linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: Fix incorrect kfree in error path
@ 2010-11-16  8:06 Axel Lin
  2010-11-16  8:08 ` [PATCH 1/5] ASoC: Fix incorrect kfree in ad1836_probe " Axel Lin
  2010-11-16  9:52 ` [PATCH 0/5] ASoC: Fix incorrect kfree in " Liam Girdwood
  0 siblings, 2 replies; 8+ messages in thread
From: Axel Lin @ 2010-11-16  8:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Liam Girdwood, Mark Brown, Barry Song, Vladimir Barinov, Richard Purdie

This serial of patches fixes incorrect kfree in error path.

Axel Lin (5):
  ASoC: Fix incorrect kfree in ad1836_probe error path
  ASoC: Fix incorrect kfree in ad193x_probe error path
  ASoC: Fix incorrect kfree in aic3x_probe error path
  ASoC: Fix incorrect kfree in wm8731_probe error path
  ASoC: Fix incorrect kfree in wm8962_probe error path

 sound/soc/codecs/ad1836.c      |    1 -
 sound/soc/codecs/ad193x.c      |    1 -
 sound/soc/codecs/tlv320aic3x.c |    1 -
 sound/soc/codecs/wm8731.c      |    1 -
 sound/soc/codecs/wm8962.c      |    1 -
 5 files changed, 0 insertions(+), 5 deletions(-)

-- 
1.7.2




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

* [PATCH 1/5] ASoC: Fix incorrect kfree in ad1836_probe error path
  2010-11-16  8:06 [PATCH 0/5] ASoC: Fix incorrect kfree in error path Axel Lin
@ 2010-11-16  8:08 ` Axel Lin
  2010-11-16  8:08   ` [PATCH 2/5] ASoC: Fix incorrect kfree in ad193x_probe " Axel Lin
  2010-11-16  9:52 ` [PATCH 0/5] ASoC: Fix incorrect kfree in " Liam Girdwood
  1 sibling, 1 reply; 8+ messages in thread
From: Axel Lin @ 2010-11-16  8:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Barry Song

We allocated memory for ad1836 in ad1836_spi_probe,
and will free the memory in either ad1836_spi_probe error path or
ad1836_spi_remove.

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

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

diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
index c71b05d..e5d3db9 100644
--- a/sound/soc/codecs/ad1836.c
+++ b/sound/soc/codecs/ad1836.c
@@ -228,7 +228,6 @@ static int ad1836_probe(struct snd_soc_codec *codec)
 	if (ret < 0) {
 		dev_err(codec->dev, "failed to set cache I/O: %d\n",
 				ret);
-		kfree(ad1836);
 		return ret;
 	}
 
-- 
1.7.2




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

* [PATCH 2/5] ASoC: Fix incorrect kfree in ad193x_probe error path
  2010-11-16  8:08 ` [PATCH 1/5] ASoC: Fix incorrect kfree in ad1836_probe " Axel Lin
@ 2010-11-16  8:08   ` Axel Lin
  2010-11-16  8:09     ` [PATCH 3/5] ASoC: Fix incorrect kfree in aic3x_probe " Axel Lin
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Lin @ 2010-11-16  8:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Barry Song

We allocated memory for ad193x in ad193x_spi_probe,
and will free the memory in either ad193x_spi_probe error path or
ad193x_spi_remove.

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

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

diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index dc105d8..fd3e659 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -364,7 +364,6 @@ static int ad193x_probe(struct snd_soc_codec *codec)
 	if (ret < 0) {
 		dev_err(codec->dev, "failed to set cache I/O: %d\n",
 				ret);
-		kfree(ad193x);
 		return ret;
 	}
 
-- 
1.7.2




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

* [PATCH 3/5] ASoC: Fix incorrect kfree in aic3x_probe error path
  2010-11-16  8:08   ` [PATCH 2/5] ASoC: Fix incorrect kfree in ad193x_probe " Axel Lin
@ 2010-11-16  8:09     ` Axel Lin
  2010-11-16  8:10       ` [PATCH 4/5] ASoC: Fix incorrect kfree in wm8731_probe " Axel Lin
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Lin @ 2010-11-16  8:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Vladimir Barinov, Liam Girdwood, Mark Brown

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




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

* [PATCH 4/5] ASoC: Fix incorrect kfree in wm8731_probe error path
  2010-11-16  8:09     ` [PATCH 3/5] ASoC: Fix incorrect kfree in aic3x_probe " Axel Lin
@ 2010-11-16  8:10       ` Axel Lin
  2010-11-16  8:11         ` [PATCH 5/5] ASoC: Fix incorrect kfree in wm8962_probe " Axel Lin
  0 siblings, 1 reply; 8+ messages in thread
From: Axel Lin @ 2010-11-16  8:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Richard Purdie, Liam Girdwood, Mark Brown

We allocated memory for wm8731 in wm8731_spi_probe / wm8731_i2c_probe,
and will free the memory in either wm8731_spi_probe / wm8731_i2c_probe
error path or wm8731_spi_remove / wm8731_i2c_remove.

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

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

diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 95ade32..4b70958 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -543,7 +543,6 @@ err_regulator_enable:
 err_regulator_get:
 	regulator_bulk_free(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
 
-	kfree(wm8731);
 	return ret;
 }
 
-- 
1.7.2




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

* [PATCH 5/5] ASoC: Fix incorrect kfree in wm8962_probe error path
  2010-11-16  8:10       ` [PATCH 4/5] ASoC: Fix incorrect kfree in wm8731_probe " Axel Lin
@ 2010-11-16  8:11         ` Axel Lin
  0 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2010-11-16  8:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

We allocated memory for wm8962 in wm8962_i2c_probe,
and will free the memory in either wm8962_i2c_probe error path
or wm8962_i2c_remove.

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

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

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index e021866..9f6beca 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3874,7 +3874,6 @@ err_enable:
 err_get:
 	regulator_bulk_free(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
 err:
-	kfree(wm8962);
 	return ret;
 }
 
-- 
1.7.2




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

* Re: [PATCH 0/5] ASoC: Fix incorrect kfree in error path
  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  9:52 ` Liam Girdwood
  2010-11-16 11:37   ` Mark Brown
  1 sibling, 1 reply; 8+ messages in thread
From: Liam Girdwood @ 2010-11-16  9:52 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Mark Brown, Barry Song, Vladimir Barinov, Richard Purdie

On Tue, 2010-11-16 at 16:06 +0800, Axel Lin wrote:
> This serial of patches fixes incorrect kfree in error path.
> 
> Axel Lin (5):
>   ASoC: Fix incorrect kfree in ad1836_probe error path
>   ASoC: Fix incorrect kfree in ad193x_probe error path
>   ASoC: Fix incorrect kfree in aic3x_probe error path
>   ASoC: Fix incorrect kfree in wm8731_probe error path
>   ASoC: Fix incorrect kfree in wm8962_probe error path
> 
>  sound/soc/codecs/ad1836.c      |    1 -
>  sound/soc/codecs/ad193x.c      |    1 -
>  sound/soc/codecs/tlv320aic3x.c |    1 -
>  sound/soc/codecs/wm8731.c      |    1 -
>  sound/soc/codecs/wm8962.c      |    1 -
>  5 files changed, 0 insertions(+), 5 deletions(-)
> 
All 

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk


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

* Re: [PATCH 0/5] ASoC: Fix incorrect kfree in error path
  2010-11-16  9:52 ` [PATCH 0/5] ASoC: Fix incorrect kfree in " Liam Girdwood
@ 2010-11-16 11:37   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2010-11-16 11:37 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: Axel Lin, linux-kernel, Barry Song, Vladimir Barinov, Richard Purdie

On Tue, Nov 16, 2010 at 09:52:45AM +0000, Liam Girdwood wrote:
> On Tue, 2010-11-16 at 16:06 +0800, Axel Lin wrote:
> > This serial of patches fixes incorrect kfree in error path.

> All 

Applied, thanks.

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

end of thread, other threads:[~2010-11-16 11:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` [PATCH 3/5] ASoC: Fix incorrect kfree in aic3x_probe " Axel Lin
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

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).