[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 <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Adrian Bunk 2005-05-01 08:59:30 -07:00 committed by Linus Torvalds
parent 0dec63bab8
commit 6c207e7692

View file

@ -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;