lkml.org 
[lkml]   [2008]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] sony-laptop.c: fix off-by-one
This patch fixes an off-by-one spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/misc/sony-laptop.c.old 2008-02-20 00:26:21.000000000 +0200
+++ linux-2.6/drivers/misc/sony-laptop.c 2008-02-20 00:26:38.000000000 +0200
@@ -314,9 +314,9 @@ static void sony_laptop_report_input_eve
kp.dev = jog_dev;
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;
}
if (sony_laptop_input_index[event] != -1) {


\
 
 \ /
  Last update: 2008-02-20 00:03    [W:5.379 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site