summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-05 09:31:33 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-03-05 09:32:21 +0100
commit5bc923c505926af927d4f3011da92c243787d6a7 (patch)
tree936e8dffa663746c0411ee842a6d0ab5cb8f9591
parentInput: wacom - replace WACOM_PKGLEN_PENABLED (diff)
downloadlinux-5bc923c505926af927d4f3011da92c243787d6a7.tar.xz
linux-5bc923c505926af927d4f3011da92c243787d6a7.zip
Input: gamecon - fix off by one range check
It should be >= GC_MAX not > GC_MAX. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/joystick/gamecon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index ae998d99a5ae..7a55714a1486 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -819,7 +819,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
int i;
int err;
- if (pad_type < 1 || pad_type > GC_MAX) {
+ if (pad_type < 1 || pad_type >= GC_MAX) {
pr_err("Pad type %d unknown\n", pad_type);
return -EINVAL;
}