linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] gamecon: fix off by one range check
@ 2010-03-03  7:05 Dan Carpenter
  2010-03-05  8:36 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-03  7:05 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Scott Moreau, linux-input, linux-kernel, kernel-janitors

It should be >= GC_MAX not > GC_MAX.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index ae998d9..7a55714 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;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] gamecon: fix off by one range check
  2010-03-03  7:05 [patch] gamecon: fix off by one range check Dan Carpenter
@ 2010-03-05  8:36 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2010-03-05  8:36 UTC (permalink / raw)
  To: Dan Carpenter, Scott Moreau, linux-input, linux-kernel,
	kernel-janitors

On Wed, Mar 03, 2010 at 10:05:44AM +0300, Dan Carpenter wrote:
> It should be >= GC_MAX not > GC_MAX.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied, thank you Dan.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-05  8:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03  7:05 [patch] gamecon: fix off by one range check Dan Carpenter
2010-03-05  8:36 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).