Messages in this thread Patch in this message | | | From | Jingoo Han <> | Subject | Re: [PATCH V2 17/18] regulator: twl: use devm_regulator_register() | Date | Thu, 26 Sep 2013 16:11:59 +0900 |
| |
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
| |