X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fregulator%2Fcore.c;h=6ec610c3b72426d643fd31ac0a6018a03b08dedf;hb=e5c973e336a5aefe8b45188c5ddc64a06b9c0c7d;hp=669d0216022195e36bcb8f59b25cf14de1dff6c9;hpb=45ff6fa1adf81f72e4815f0a993a644467b7b185;p=pandora-kernel.git diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 669d02160221..6ec610c3b724 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2765,6 +2765,8 @@ unset_supplies: unset_regulator_supplies(rdev); scrub: + if (rdev->supply) + regulator_put(rdev->supply); kfree(rdev->constraints); device_unregister(&rdev->dev); /* device core frees rdev */ @@ -2799,8 +2801,8 @@ void regulator_unregister(struct regulator_dev *rdev) list_del(&rdev->list); if (rdev->supply) regulator_put(rdev->supply); - device_unregister(&rdev->dev); kfree(rdev->constraints); + device_unregister(&rdev->dev); mutex_unlock(®ulator_list_mutex); } EXPORT_SYMBOL_GPL(regulator_unregister);