lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1313405127-2724-3-git-send-email-jhovold@gmail.com>
Date:	Mon, 15 Aug 2011 12:45:27 +0200
From:	Johan Hovold <jhovold@...il.com>
To:	Liam Girdwood <lrg@...com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Liam Girdwood <lrg@...mlogic.co.uk>,
	Jorge Eduardo Candelaria <jedu@...mlogic.co.uk>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	linux-kernel@...r.kernel.org, Johan Hovold <jhovold@...il.com>
Subject: [PATCH 3/3] regulator: tps65910: verify dcdc regulator ids

Add default case to switches in dcdc voltage functions.

Signed-off-by: Johan Hovold <jhovold@...il.com>
---
 drivers/regulator/tps65910-regulator.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 2c61e48..991dfa4 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -534,6 +534,8 @@ static int tps65910_get_voltage_dcdc(struct regulator_dev *dev)
 		srvsel &= VDDCTRL_SR_SEL_MASK;
 		vselmax = 64;
 		break;
+	default:
+		return -EINVAL;
 	}
 
 	/* multiplier 0 == 1 but 2,3 normal */
@@ -688,6 +690,9 @@ static int tps65910_set_voltage_dcdc(struct regulator_dev *dev,
 	case TPS65911_REG_VDDCTRL:
 		vsel = selector;
 		tps65910_reg_write(pmic, TPS65911_VDDCTRL_OP, vsel);
+		break;
+	default:
+		return -EINVAL;
 	}
 
 	return 0;
@@ -762,6 +767,9 @@ static int tps65910_list_voltage_dcdc(struct regulator_dev *dev,
 		break;
 	case TPS65911_REG_VDDCTRL:
 		volt = VDDCTRL_MIN_VOLT + (selector * VDDCTRL_OFFSET);
+		break;
+	default:
+		return -EINVAL;
 	}
 
 	return  volt * 100 * mult;
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ