Skip to content

Commit

Permalink
regulator: core: Release regulator-regulator supplies on error
Browse files Browse the repository at this point in the history
If we fail while registering a regulator make sure we release the supply
for the regulator if there is one.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Mark Brown committed May 14, 2012
1 parent 41097af commit e81dba8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,8 @@ regulator_register(const struct regulator_desc *regulator_desc,
unset_regulator_supplies(rdev);

scrub:
if (rdev->supply)
regulator_put(rdev->supply);
kfree(rdev->constraints);
device_unregister(&rdev->dev);
/* device core frees rdev */
Expand Down

0 comments on commit e81dba8

Please sign in to comment.