From: Dan Carpenter Date: Fri, 5 Mar 2010 08:31:33 +0000 (-0800) Subject: Input: gamecon - fix off by one range check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5bc923c505926af927d4f3011da92c243787d6a7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Input: gamecon - fix off by one range check It should be >= GC_MAX not > GC_MAX. Signed-off-by: Dan Carpenter Signed-off-by: Dmitry Torokhov --- 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; }