projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddec681
)
regulator: keep index within bounds in da9034_get_ldo12_voltage()
author
Roel Kluin
<
[email protected]
>
Mon, 26 Oct 2009 11:37:11 +0000
(12:37 +0100)
committer
Liam Girdwood
<
[email protected]
>
Thu, 17 Dec 2009 10:27:25 +0000
(10:27 +0000)
If selector equals ARRAY_SIZE(da9034_ldo12_data), that is one too
large already.
Signed-off-by: Roel Kluin <
[email protected]
>
Acked-by: Mark Brown <
[email protected]
>
Signed-off-by: Liam Girdwood <
[email protected]
>
drivers/regulator/da903x.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/da903x.c
b/drivers/regulator/da903x.c
index aa224d936e0de4c92665faf14115bc5592e63bde..f8c4661a7a81ae82705b51691669e230553203b1 100644
(file)
--- a/
drivers/regulator/da903x.c
+++ b/
drivers/regulator/da903x.c
@@
-331,7
+331,7
@@
static int da9034_get_ldo12_voltage(struct regulator_dev *rdev)
static int da9034_list_ldo12_voltage(struct regulator_dev *rdev,
unsigned selector)
{
- if (selector > ARRAY_SIZE(da9034_ldo12_data))
+ if (selector >
=
ARRAY_SIZE(da9034_ldo12_data))
return -EINVAL;
return da9034_ldo12_data[selector] * 1000;
}