Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Feb 12, 2010
2 parents b49199c + 62737d4 commit 280c96b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
static void print_constraints(struct regulator_dev *rdev)
{
struct regulation_constraints *constraints = rdev->constraints;
char buf[80];
char buf[80] = "";
int count = 0;
int ret;

Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/lp3971.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static int lp3971_ldo_set_voltage(struct regulator_dev *dev,
if (vol_map[val] >= min_vol)
break;

if (vol_map[val] > max_vol)
if (val > LDO_VOL_MAX_IDX || vol_map[val] > max_vol)
return -EINVAL;

return lp3971_set_bits(lp3971, LP3971_LDO_VOL_CONTR_REG(ldo),
Expand Down Expand Up @@ -272,7 +272,7 @@ static int lp3971_dcdc_set_voltage(struct regulator_dev *dev,
if (vol_map[val] >= min_vol)
break;

if (vol_map[val] > max_vol)
if (val > BUCK_TARGET_VOL_MAX_IDX || vol_map[val] > max_vol)
return -EINVAL;

ret = lp3971_set_bits(lp3971, LP3971_BUCK_TARGET_VOL1_REG(buck),
Expand Down

0 comments on commit 280c96b

Please sign in to comment.