Skip to content

Commit

Permalink
Input: gamecon - fix off by one range check
Browse files Browse the repository at this point in the history
It should be >= GC_MAX not > GC_MAX.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dan Carpenter authored and Dmitry Torokhov committed Mar 5, 2010
1 parent 57e413d commit 5bc923c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5bc923c

Please sign in to comment.