Skip to content

Commit

Permalink
sony-laptop.c: fix off-by-one
Browse files Browse the repository at this point in the history
This patch fixes an off-by-one spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Adrian Bunk authored and Len Brown committed Feb 21, 2008
1 parent e80af3a commit d399d13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static void sony_laptop_report_input_event(u8 event)
break;

default:
if (event > ARRAY_SIZE(sony_laptop_input_index)) {
if (event >= ARRAY_SIZE(sony_laptop_input_index)) {
dprintk("sony_laptop_report_input_event, event not known: %d\n", event);
break;
}
Expand Down

0 comments on commit d399d13

Please sign in to comment.