X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fregulator%2Fcore.c;h=2dd98387bc40b0d6a810afcfe024f65e8814ee9e;hb=68cebcb01852fc457bcf244b3c7760c037398080;hp=669d0216022195e36bcb8f59b25cf14de1dff6c9;hpb=fb14ca438c0a54306419ee648d9d146c5e7be679;p=pandora-kernel.git diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 669d02160221..2dd98387bc40 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -726,7 +726,7 @@ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state) static void print_constraints(struct regulator_dev *rdev) { struct regulation_constraints *constraints = rdev->constraints; - char buf[80] = ""; + char buf[160] = ""; int count = 0; int ret; @@ -1314,12 +1314,14 @@ void regulator_put(struct regulator *regulator) device_remove_file(regulator->dev, ®ulator->dev_attr); kfree(regulator->dev_attr.attr.name); } + mutex_lock(&rdev->mutex); kfree(regulator->supply_name); list_del(®ulator->list); kfree(regulator); rdev->open_count--; rdev->exclusive = 0; + mutex_unlock(&rdev->mutex); module_put(rdev->owner); mutex_unlock(®ulator_list_mutex); @@ -2765,6 +2767,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 +2803,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);