diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-13 18:35:56 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-31 00:43:26 +0100 |
commit | e669d42fc1dd792d21d2d5d97c124dc0f6d147ea (patch) | |
tree | c6c27e1d1d82434624e1edf478e8f4d5fea796ae | |
parent | d704f9240928c3ca88ea166c5175a9c66ea48564 (diff) |
regulator: core: Release regulator-regulator supplies on error
commit e81dba85c6388dfabcb76cbc2b8bd02836a53ae5 upstream.
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/regulator/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 938398f3e869..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 */ |