lkml.org 
[lkml]   [2011]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] regulator: tps65910: Fix a memory leak in tps65910_probe error path
From
Date
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



\
 
 \ /
  Last update: 2011-07-22 12:49    [W:0.405 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site