From: Adrian Bunk Date: Sun, 1 May 2005 15:59:30 +0000 (-0700) Subject: [PATCH] drivers/input/joystick/spaceorb.c: fix an array overflow X-Git-Tag: v2.6.12-rc4~136^2~14 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6c207e769297946a0adec45225c6999f1299dde3;p=linux-2.6-omap-h63xx.git [PATCH] drivers/input/joystick/spaceorb.c: fix an array overflow This patch fixes an array overflow found by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index c76cf8ff29c..874367bfab0 100644 --- a/drivers/input/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c @@ -116,7 +116,7 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb, struct pt_regs *r case 'K': /* Button data */ if (spaceorb->idx != 5) return; - for (i = 0; i < 7; i++) + for (i = 0; i < 6; i++) input_report_key(dev, spaceorb_buttons[i], (data[2] >> i) & 1); break;