projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97ddb1c
)
gpio: lpc32xx: Fix off-by-one valid range checking for bank
author
Axel Lin
<axel.lin@ingics.com>
Sun, 7 Apr 2013 12:28:20 +0000
(20:28 +0800)
committer
Linus Walleij
<linus.walleij@linaro.org>
Wed, 10 Apr 2013 21:41:17 +0000
(23:41 +0200)
The valid bank should be 0 ... ARRAY_SIZE(lpc32xx_gpiochip) - 1.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-lpc32xx.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-lpc32xx.c
b/drivers/gpio/gpio-lpc32xx.c
index 36d7dee07b28c9b1e66df8edf6699168fdf0a00f..dda6a756a3d9946b6d51693a9e09fe48c3cd4ac9 100644
(file)
--- a/
drivers/gpio/gpio-lpc32xx.c
+++ b/
drivers/gpio/gpio-lpc32xx.c
@@
-533,7
+533,7
@@
static int lpc32xx_of_xlate(struct gpio_chip *gc,
{
/* Is this the correct bank? */
u32 bank = gpiospec->args[0];
- if ((bank > ARRAY_SIZE(lpc32xx_gpiochip) ||
+ if ((bank >
=
ARRAY_SIZE(lpc32xx_gpiochip) ||
(gc != &lpc32xx_gpiochip[bank].chip)))
return -EINVAL;