Re: [PATCH V2 07/18] regulator: lp3971: use devm_regulator_register()

From: Jingoo Han
Date: Thu Sep 26 2013 - 02:36:11 EST


On Thursday, September 26, 2013 11:08 AM, Jingoo Han wrote:
>
> Use devm_regulator_register() to make cleanup paths simpler.
>
> Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx>
> ---
> drivers/regulator/lp3971.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>

[....]

> @@ -463,10 +462,6 @@ static int lp3971_i2c_probe(struct i2c_client *i2c,
> static int lp3971_i2c_remove(struct i2c_client *i2c)
> {
> struct lp3971 *lp3971 = i2c_get_clientdata(i2c);
> - int i;
> -
> - for (i = 0; i < lp3971->num_regulators; i++)
> - regulator_unregister(lp3971->rdev[i]);
>
> kfree(lp3971->rdev);

CC'ed Sachin Kamat,

Calling regulator_unregister(lp3971->rdev) after kfree(lp3971->rdev)
would make the problem.
I will remove this patch from next v3 patch series.

Best regards,
Jingoo Han


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/