diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-05 03:31:33 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-03-05 03:32:21 -0500 |
commit | 5bc923c505926af927d4f3011da92c243787d6a7 (patch) | |
tree | 936e8dffa663746c0411ee842a6d0ab5cb8f9591 /drivers/input | |
parent | 57e413d95b0f92b9a5569408ddc3441e0f20e856 (diff) |
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>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/joystick/gamecon.c | 2 |
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) | |||
819 | int i; | 819 | int i; |
820 | int err; | 820 | int err; |
821 | 821 | ||
822 | if (pad_type < 1 || pad_type > GC_MAX) { | 822 | if (pad_type < 1 || pad_type >= GC_MAX) { |
823 | pr_err("Pad type %d unknown\n", pad_type); | 823 | pr_err("Pad type %d unknown\n", pad_type); |
824 | return -EINVAL; | 824 | return -EINVAL; |
825 | } | 825 | } |