]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
panasonic-laptop: fix X[ ARRAY_SIZE(X) ]
authorRoel Kluin <roel.kluin@gmail.com>
Sat, 17 Jan 2009 14:51:27 +0000 (15:51 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Feb 2009 17:50:33 +0000 (09:50 -0800)
commit 2b190e76def5233c542f6025b4a133b1d4bd1a37 upstream.

Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/misc/panasonic-laptop.c

index 4a1bc64485d5a61523a2eaee5975555c843ac859..d82d1cc9bd8dd44a3db1c122bae84ee907a5770f 100644 (file)
@@ -515,7 +515,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
 
        hkey_num = result & 0xf;
 
-       if (hkey_num < 0 || hkey_num > ARRAY_SIZE(pcc->keymap)) {
+       if (hkey_num < 0 || hkey_num >= ARRAY_SIZE(pcc->keymap)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                  "hotkey number out of range: %d\n",
                                  hkey_num));