]> err.no Git - linux-2.6/commitdiff
sony-laptop.c: fix off-by-one
authorAdrian Bunk <bunk@kernel.org>
Tue, 19 Feb 2008 22:59:03 +0000 (00:59 +0200)
committerLen Brown <len.brown@intel.com>
Thu, 21 Feb 2008 09:49:24 +0000 (04:49 -0500)
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>
drivers/misc/sony-laptop.c

index 899e3f75f288dd853a50f61e9c15772ea3d60b01..02ff3d19b1ccaf40981c861e9977c43eea634f3f 100644 (file)
@@ -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;
                }