diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-12 11:48:35 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-12 11:48:35 -0500 |
| commit | 280c96b16a732cec207ccef7f70cb9ec727d3fd9 (patch) | |
| tree | 51deef0c50e14960bedb78b0b84f974fadc89889 | |
| parent | b49199c827d81c6dfb8ebb325292aa6b94b45e3d (diff) | |
| parent | 62737d445b149eaf0beac50de8d856b5e94150be (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
regulator/lp3971: vol_map out of bounds in lp3971_{ldo,dcdc}_set_voltage()
regulator: Fix display of null constraints for regulators
| -rw-r--r-- | drivers/regulator/core.c | 2 | ||||
| -rw-r--r-- | drivers/regulator/lp3971.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 686ef270ecf7..b60a4c9f8f16 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -661,7 +661,7 @@ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state) | |||
| 661 | static void print_constraints(struct regulator_dev *rdev) | 661 | static void print_constraints(struct regulator_dev *rdev) |
| 662 | { | 662 | { |
| 663 | struct regulation_constraints *constraints = rdev->constraints; | 663 | struct regulation_constraints *constraints = rdev->constraints; |
| 664 | char buf[80]; | 664 | char buf[80] = ""; |
| 665 | int count = 0; | 665 | int count = 0; |
| 666 | int ret; | 666 | int ret; |
| 667 | 667 | ||
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index 76d08c282f9c..4f33a0f4a179 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c | |||
| @@ -183,7 +183,7 @@ static int lp3971_ldo_set_voltage(struct regulator_dev *dev, | |||
| 183 | if (vol_map[val] >= min_vol) | 183 | if (vol_map[val] >= min_vol) |
| 184 | break; | 184 | break; |
| 185 | 185 | ||
| 186 | if (vol_map[val] > max_vol) | 186 | if (val > LDO_VOL_MAX_IDX || vol_map[val] > max_vol) |
| 187 | return -EINVAL; | 187 | return -EINVAL; |
| 188 | 188 | ||
| 189 | return lp3971_set_bits(lp3971, LP3971_LDO_VOL_CONTR_REG(ldo), | 189 | return lp3971_set_bits(lp3971, LP3971_LDO_VOL_CONTR_REG(ldo), |
| @@ -272,7 +272,7 @@ static int lp3971_dcdc_set_voltage(struct regulator_dev *dev, | |||
| 272 | if (vol_map[val] >= min_vol) | 272 | if (vol_map[val] >= min_vol) |
| 273 | break; | 273 | break; |
| 274 | 274 | ||
| 275 | if (vol_map[val] > max_vol) | 275 | if (val > BUCK_TARGET_VOL_MAX_IDX || vol_map[val] > max_vol) |
| 276 | return -EINVAL; | 276 | return -EINVAL; |
| 277 | 277 | ||
| 278 | ret = lp3971_set_bits(lp3971, LP3971_BUCK_TARGET_VOL1_REG(buck), | 278 | ret = lp3971_set_bits(lp3971, LP3971_BUCK_TARGET_VOL1_REG(buck), |
