From: Roel Kluin Date: Sat, 17 Jan 2009 14:51:27 +0000 (+0100) Subject: panasonic-laptop: fix X[ ARRAY_SIZE(X) ] X-Git-Tag: firefly_0821_release~15612^2^6~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b190e76def5233c542f6025b4a133b1d4bd1a37;p=firefly-linux-kernel-4.4.55.git panasonic-laptop: fix X[ ARRAY_SIZE(X) ] Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur. Signed-off-by: Roel Kluin Signed-off-by: Len Brown --- diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index f30db367c82e..c47a44dcb702 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -507,7 +507,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));