mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] drivers/mfd/sm501.c: fix an off-by-one
Fix an off-by-one spotted by the Coverity checker. Signed-off-by: Adrian Bunk <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Vincent Sanders <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
10fa1155a2
commit
bf703c3f19
1 changed files with 1 additions and 1 deletions
|
|
@ -319,7 +319,7 @@ int sm501_unit_power(struct device *dev, unsigned int unit, unsigned int to)
|
|||
|
||||
mode &= 3; /* get current power mode */
|
||||
|
||||
if (unit > ARRAY_SIZE(sm->unit_power)) {
|
||||
if (unit >= ARRAY_SIZE(sm->unit_power)) {
|
||||
dev_err(dev, "%s: bad unit %d\n", __FUNCTION__, unit);
|
||||
goto already;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue