linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path
@ 2011-07-10 10:52 Axel Lin
  2011-07-10 11:10 ` Mark Brown
  2011-07-22 10:47 ` Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2011-07-10 10:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Graeme Gregory, Liam Girdwood, Mark Brown

Fix a memory leak if chip id is not matched.

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

diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index fe8dc02..e15aac6 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -909,6 +909,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
 		break;
 	default:
 		pr_err("Invalid tps chip version\n");
+		kfree(pmic);
 		return -ENODEV;
 	}
 
-- 
1.7.4.1




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

* Re: [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path
  2011-07-10 10:52 [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path Axel Lin
@ 2011-07-10 11:10 ` Mark Brown
  2011-07-22 10:47 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-07-10 11:10 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Graeme Gregory, Liam Girdwood

On Sun, Jul 10, 2011 at 06:52:07PM +0800, Axel Lin wrote:
> Fix a memory leak if chip id is not matched.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* Re: [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path
  2011-07-10 10:52 [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path Axel Lin
  2011-07-10 11:10 ` Mark Brown
@ 2011-07-22 10:47 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-07-22 10:47 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Graeme Gregory, Liam Girdwood, Mark Brown

On Sun, 2011-07-10 at 18:52 +0800, Axel Lin wrote:
> Fix a memory leak if chip id is not matched.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/regulator/tps65910-regulator.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
> index fe8dc02..e15aac6 100644
> --- a/drivers/regulator/tps65910-regulator.c
> +++ b/drivers/regulator/tps65910-regulator.c
> @@ -909,6 +909,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
>  		break;
>  	default:
>  		pr_err("Invalid tps chip version\n");
> +		kfree(pmic);
>  		return -ENODEV;
>  	}
>  

Applied.

Thanks

Liam


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

end of thread, other threads:[~2011-07-22 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-10 10:52 [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path Axel Lin
2011-07-10 11:10 ` Mark Brown
2011-07-22 10:47 ` Liam Girdwood

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