]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: core: Release regulator-regulator supplies on error
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 13 May 2012 17:35:56 +0000 (18:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:15:41 +0000 (15:15 +0800)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/core.c

index e9a83f84adaf53771d94bd3b3761deb7cad2ca32..9d4b03ba86dd834e36b6bbce897fd6da601fa836 100644 (file)
@@ -2877,6 +2877,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 */