diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-06-15 22:30:39 +0200 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-09-22 13:32:35 +0100 |
commit | 4dee4d441d3f90cd8cec10a9eb222d8a4f2fa2a3 (patch) | |
tree | b246cd1f654cee874a055031d84f53bd4c5150bd | |
parent | 43c1266ce4dc06bfd236cec31e11e9ecd69c0bef (diff) |
regulator: add check index of wm8350->pmic.pdev[]
Ensure that reg is within the bounds of array wm8350->pmic.pdev[].
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | drivers/regulator/wm8350-regulator.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 17a00b0fafd..768bd0e5b48 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -1419,6 +1419,8 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, { struct platform_device *pdev; int ret; + if (reg < 0 || reg >= NUM_WM8350_REGULATORS) + return -EINVAL; if (wm8350->pmic.pdev[reg]) return -EBUSY; |