diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 68473d0cc57e..968dcd9d7a07 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3322,15 +3322,12 @@ static int regulator_set_voltage_unlocked(struct regulator *regulator, /* for not coupled regulators this will just set the voltage */ ret = regulator_balance_voltage(rdev, state); - if (ret < 0) - goto out2; + if (ret < 0) { + voltage->min_uV = old_min_uV; + voltage->max_uV = old_max_uV; + } out: - return 0; -out2: - voltage->min_uV = old_min_uV; - voltage->max_uV = old_max_uV; - return ret; }