diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-03-15 00:49:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-26 13:32:11 -0400 |
commit | 5777d9b34aec841429ddade56403b3f53a821a1d (patch) | |
tree | e3c6b8dee5cf9f9884964d101f892de1a6fea287 /drivers | |
parent | 09bf14b901f2c1908b6a72fe934457acdd1fa430 (diff) |
regulator: Fix unbalanced lock/unlock in mc13892_regulator_probe error path
We do not hold a lock while registering regulator, thus should not call unlock
if regulator_register fails.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/mc13892-regulator.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index e8cfc99dd8f0..845aa2263b8a 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c | |||
@@ -552,7 +552,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
552 | mc13xxx_lock(mc13892); | 552 | mc13xxx_lock(mc13892); |
553 | ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val); | 553 | ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val); |
554 | if (ret) | 554 | if (ret) |
555 | goto err_free; | 555 | goto err_unlock; |
556 | 556 | ||
557 | /* enable switch auto mode */ | 557 | /* enable switch auto mode */ |
558 | if ((val & 0x0000FFFF) == 0x45d0) { | 558 | if ((val & 0x0000FFFF) == 0x45d0) { |
@@ -562,7 +562,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
562 | MC13892_SWITCHERS4_SW1MODE_AUTO | | 562 | MC13892_SWITCHERS4_SW1MODE_AUTO | |
563 | MC13892_SWITCHERS4_SW2MODE_AUTO); | 563 | MC13892_SWITCHERS4_SW2MODE_AUTO); |
564 | if (ret) | 564 | if (ret) |
565 | goto err_free; | 565 | goto err_unlock; |
566 | 566 | ||
567 | ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5, | 567 | ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5, |
568 | MC13892_SWITCHERS5_SW3MODE_M | | 568 | MC13892_SWITCHERS5_SW3MODE_M | |
@@ -570,7 +570,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
570 | MC13892_SWITCHERS5_SW3MODE_AUTO | | 570 | MC13892_SWITCHERS5_SW3MODE_AUTO | |
571 | MC13892_SWITCHERS5_SW4MODE_AUTO); | 571 | MC13892_SWITCHERS5_SW4MODE_AUTO); |
572 | if (ret) | 572 | if (ret) |
573 | goto err_free; | 573 | goto err_unlock; |
574 | } | 574 | } |
575 | mc13xxx_unlock(mc13892); | 575 | mc13xxx_unlock(mc13892); |
576 | 576 | ||
@@ -612,10 +612,10 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
612 | err: | 612 | err: |
613 | while (--i >= 0) | 613 | while (--i >= 0) |
614 | regulator_unregister(priv->regulators[i]); | 614 | regulator_unregister(priv->regulators[i]); |
615 | return ret; | ||
615 | 616 | ||
616 | err_free: | 617 | err_unlock: |
617 | mc13xxx_unlock(mc13892); | 618 | mc13xxx_unlock(mc13892); |
618 | |||
619 | return ret; | 619 | return ret; |
620 | } | 620 | } |
621 | 621 | ||