Input: gamecon - fix off by one range check
authorDan Carpenter <error27@gmail.com>
Fri, 5 Mar 2010 08:31:33 +0000 (00:31 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 5 Mar 2010 08:32:21 +0000 (00:32 -0800)
It should be >= GC_MAX not > GC_MAX.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/joystick/gamecon.c

index ae998d99a5ae619b87d66bd8e20ebf5c1c2a5571..7a55714a14866386909153cf794844918bb09a1a 100644 (file)
@@ -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;
        }