lkml.org 
[lkml]   [2013]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH V2 17/18] regulator: twl: use devm_regulator_register()
Date
On Thursday, September 26, 2013 11:13 AM, Jingoo Han wrote:
>
> Use devm_regulator_register() to make cleanup paths simpler.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Nishanth Menon <nm@ti.com>
> ---
> drivers/regulator/twl-regulator.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

[.....]

> @@ -1217,7 +1217,6 @@ static int twlreg_remove(struct platform_device *pdev)
> struct regulator_dev *rdev = platform_get_drvdata(pdev);
> struct twlreg_info *info = rdev->reg_data;
>
> - regulator_unregister(rdev);
> kfree(info);
> return 0;
> }

kfree(info) is kfree(rdev->reg_data).
The following would be right.
1. kfree(rdev->reg_data)
2. regulator_unregister(rdev)

Also, regulator_unregister() does not access 'rdev->reg_data'.
So, it would not make the problem.

Best regards,
Jingoo Han


\
 
 \ /
  Last update: 2013-09-26 09:21    [W:0.158 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site