projects
/
profile
/
ivi
/
kernel-adaptation-intel-automotive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43c1266
)
regulator: add check index of wm8350->pmic.pdev[]
author
Roel Kluin
<roel.kluin@gmail.com>
Mon, 15 Jun 2009 20:30:39 +0000
(22:30 +0200)
committer
Liam Girdwood
<lrg@slimlogic.co.uk>
Tue, 22 Sep 2009 12:32:35 +0000
(13:32 +0100)
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>
drivers/regulator/wm8350-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/wm8350-regulator.c
b/drivers/regulator/wm8350-regulator.c
index
17a00b0
..
768bd0e
100644
(file)
--- 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;