All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] ASoC: sgtl5000: use after free in ldo_regulator_register()
@ 2011-03-08 11:39 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2011-03-08 11:39 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: alsa-devel, Zeng Zhaoming, Takashi Iwai, Mark Brown,
	kernel-janitors

The "ldo" variable was dereferenced after free on the error path.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index b7e97c0..1f7217f 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -875,11 +875,13 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
 	ldo->dev = regulator_register(&ldo->desc, codec->dev,
 					  init_data, ldo);
 	if (IS_ERR(ldo->dev)) {
+		int ret = PTR_ERR(ldo->dev);
+
 		dev_err(codec->dev, "failed to register regulator\n");
 		kfree(ldo->desc.name);
 		kfree(ldo);
 
-		return PTR_ERR(ldo->dev);
+		return ret;
 	}
 
 	return 0;

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

* [patch] ASoC: sgtl5000: use after free in ldo_regulator_register()
@ 2011-03-08 11:39 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2011-03-08 11:39 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: alsa-devel, Zeng Zhaoming, Takashi Iwai, Mark Brown,
	kernel-janitors

The "ldo" variable was dereferenced after free on the error path.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index b7e97c0..1f7217f 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -875,11 +875,13 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
 	ldo->dev = regulator_register(&ldo->desc, codec->dev,
 					  init_data, ldo);
 	if (IS_ERR(ldo->dev)) {
+		int ret = PTR_ERR(ldo->dev);
+
 		dev_err(codec->dev, "failed to register regulator\n");
 		kfree(ldo->desc.name);
 		kfree(ldo);
 
-		return PTR_ERR(ldo->dev);
+		return ret;
 	}
 
 	return 0;

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

* Re: [patch] ASoC: sgtl5000: use after free in ldo_regulator_register()
  2011-03-08 11:39 ` Dan Carpenter
@ 2011-03-08 18:00   ` Liam Girdwood
  -1 siblings, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2011-03-08 18:00 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Takashi Iwai, alsa-devel, Mark Brown, kernel-janitors,
	Zeng Zhaoming

On Tue, 2011-03-08 at 14:39 +0300, Dan Carpenter wrote:
> The "ldo" variable was dereferenced after free on the error path.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Liam Girdwood <lrg@ti.com>

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

* Re: [alsa-devel] [patch] ASoC: sgtl5000: use after free in
@ 2011-03-08 18:00   ` Liam Girdwood
  0 siblings, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2011-03-08 18:00 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Takashi Iwai, alsa-devel, Mark Brown, kernel-janitors,
	Zeng Zhaoming

On Tue, 2011-03-08 at 14:39 +0300, Dan Carpenter wrote:
> The "ldo" variable was dereferenced after free on the error path.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Liam Girdwood <lrg@ti.com>


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

* Re: [patch] ASoC: sgtl5000: use after free in ldo_regulator_register()
  2011-03-08 11:39 ` Dan Carpenter
@ 2011-03-08 18:57   ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2011-03-08 18:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: alsa-devel, Zeng Zhaoming, Takashi Iwai, kernel-janitors,
	Liam Girdwood

On Tue, Mar 08, 2011 at 02:39:24PM +0300, Dan Carpenter wrote:
> The "ldo" variable was dereferenced after free on the error path.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 

Applied, thanks.

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

* Re: [patch] ASoC: sgtl5000: use after free in
@ 2011-03-08 18:57   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2011-03-08 18:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: alsa-devel, Zeng Zhaoming, Takashi Iwai, kernel-janitors,
	Liam Girdwood

On Tue, Mar 08, 2011 at 02:39:24PM +0300, Dan Carpenter wrote:
> The "ldo" variable was dereferenced after free on the error path.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 

Applied, thanks.

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

end of thread, other threads:[~2011-03-08 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 11:39 [patch] ASoC: sgtl5000: use after free in ldo_regulator_register() Dan Carpenter
2011-03-08 11:39 ` Dan Carpenter
2011-03-08 18:00 ` Liam Girdwood
2011-03-08 18:00   ` [alsa-devel] [patch] ASoC: sgtl5000: use after free in Liam Girdwood
2011-03-08 18:57 ` [patch] ASoC: sgtl5000: use after free in ldo_regulator_register() Mark Brown
2011-03-08 18:57   ` [patch] ASoC: sgtl5000: use after free in 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.