summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-02 19:54:17 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-02 19:26:04 +0200
commit1a5d39d0644fa01e659ee42b5ec47abbd7db3afb (patch)
treeb22189d061a6178db4030259f149e479dd02652e /drivers
parentregulator: tps6524x: Convert fixed ilimsel to table based (diff)
downloadlinux-1a5d39d0644fa01e659ee42b5ec47abbd7db3afb.tar.xz
linux-1a5d39d0644fa01e659ee42b5ec47abbd7db3afb.zip
regulator: tps65217: invalid if check
This permits the setting of bogus values because the invalidity check is itself invalid. Reported-by: dcb314@hotmail.com Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/tps65217-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index 3a2b839276fe..0a3df5b7c904 100644
--- a/drivers/regulator/tps65217-regulator.c
+++ b/drivers/regulator/tps65217-regulator.c
@@ -78,7 +78,7 @@ static int tps65217_vsel_to_uv1(unsigned int vsel)
static int tps65217_uv_to_vsel1(int uV, unsigned int *vsel)
{
- if ((uV < 0) && (uV > 3300000))
+ if (uV < 0 || uV > 3300000)
return -EINVAL;
if (uV <= 1500000)
@@ -112,7 +112,7 @@ static int tps65217_vsel_to_uv2(unsigned int vsel)
static int tps65217_uv_to_vsel2(int uV, unsigned int *vsel)
{
- if ((uV < 0) && (uV > 3300000))
+ if (uV < 0 || uV > 3300000)
return -EINVAL;
if (uV <= 1900000)