OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
caca6a0
)
regulator: aat2870: Fix the logic of checking if no id is matched in aat2870_get_regu...
author
Axel Lin
<axel.lin@gmail.com>
Mon, 28 Nov 2011 06:06:31 +0000
(14:06 +0800)
committer
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Mon, 28 Nov 2011 11:48:15 +0000
(11:48 +0000)
In current implementation, the pointer ri is not NULL if no id is matched.
Fix it by checking i == ARRAY_SIZE(aat2870_regulators) if no id is matched.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
drivers/regulator/aat2870-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/aat2870-regulator.c
b/drivers/regulator/aat2870-regulator.c
index
5abeb3a
..
298c6c6
100644
(file)
--- a/
drivers/regulator/aat2870-regulator.c
+++ b/
drivers/regulator/aat2870-regulator.c
@@
-160,7
+160,7
@@
static struct aat2870_regulator *aat2870_get_regulator(int id)
break;
}
- if (
!ri
)
+ if (
i == ARRAY_SIZE(aat2870_regulators)
)
return NULL;
ri->enable_addr = AAT2870_LDO_EN;