gamecon: fix off by one range check
Subsystems (3)
PATCH 1/1 gamecon: fix off by one range check
It should be >= GC_MAX not > GC_MAX.
Signed-off-by Dan Carpenter <[email protected]>
drivers/input/joystick/gamecon.c +1 -1
@@ -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 ; }
Quoted 3 lines · Dan Carpenter
It should be >=
GC_MAXnot >GC_MAX.Signed-off-by Dan Carpenter <[email protected]>
Applied, thank you Dan.
Signature · 1 line
Dmitry