diff options
author | Adrian Bunk <bunk@stusta.de> | 2007-04-02 08:49:38 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-02 19:06:08 +0200 |
commit | bf703c3f199342da440a30798b6120f391741ffe (patch) | |
tree | dceadb855e56f249841c746f8a8e6ffa338efe5f /drivers/mfd/sm501.c | |
parent | [PATCH] uml: fix unreasonably long udelay (diff) | |
download | linux-bf703c3f199342da440a30798b6120f391741ffe.tar.xz linux-bf703c3f199342da440a30798b6120f391741ffe.zip |
[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 <bunk@stusta.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Vincent Sanders <vince@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mfd/sm501.c')
-rw-r--r-- | drivers/mfd/sm501.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index c707c8ebc1a2..b0b4458ae90b 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -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; } |