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:
d06563c
)
regulator: ab8500 - fix off-by-one value range checking for selector
author
Axel Lin
<
[email protected]
>
Sat, 4 Sep 2010 15:06:41 +0000
(23:06 +0800)
committer
Liam Girdwood
<
[email protected]
>
Sun, 5 Sep 2010 10:15:52 +0000
(11:15 +0100)
selector is used as array index of info->supported_voltages
Thus the valid value range should be 0 .. info->voltages_len -1
Signed-off-by: Axel Lin <
[email protected]
>
Acked-by: Mark Brown <
[email protected]
>
Signed-off-by: Liam Girdwood <
[email protected]
>
drivers/regulator/ab8500.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/ab8500.c
b/drivers/regulator/ab8500.c
index 3d09580dc883245811d5607e3b56f7f829a2f95b..28c7ae67cec9ea1d573c94b30d8732f7770340b0 100644
(file)
--- a/
drivers/regulator/ab8500.c
+++ b/
drivers/regulator/ab8500.c
@@
-157,7
+157,7
@@
static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector)
if (info->fixed_uV)
return info->fixed_uV;
- if (selector > info->voltages_len)
+ if (selector >
=
info->voltages_len)
return -EINVAL;
return info->supported_voltages[selector];