mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
regulator: core: Release regulator-regulator supplies on error
commit e81dba85c6
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
44f289c7e6
commit
4666b31d6d
@ -2877,6 +2877,8 @@ struct regulator_dev *regulator_register(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 */
|
||||
|
Loading…
Reference in New Issue
Block a user