* [PATCH] regulator: core: Release regulator-regulator supplies on error
@ 2012-05-13 17:37 Mark Brown
2012-05-14 8:22 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2012-05-13 17:37 UTC (permalink / raw)
To: Liam Girdwood; +Cc: linux-kernel, Mark Brown
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>
---
drivers/regulator/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index a3cfaea..28b9c31 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3196,6 +3196,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 */
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-14 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-13 17:37 [PATCH] regulator: core: Release regulator-regulator supplies on error Mark Brown
2012-05-14 8:22 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox